레이블이 시샵교육인 게시물을 표시합니다. 모든 게시물 표시
레이블이 시샵교육인 게시물을 표시합니다. 모든 게시물 표시

2022년 3월 2일 수요일

(C#교육동영상)C# ADO.NET 실습 ODP.NET/ODAC 설치 오라클 함수 호출 실습, C#학원, WPF학원, 닷넷학원, 자바학원

 (C#교육동영상)C# ADO.NET 실습  ODP.NET/ODAC 설치  오라클 함수 호출 실습, C#학원, WPF학원, 닷넷학원, 자바학원


https://www.youtube.com/watch?v=qIPU85yAlzc&list=PLxU-iZCqT52CtVOhmaR6Nd-65M163g9u-&index=5 

https://www.youtube.com/watch?v=3EVBaefJzAs&list=PLxU-iZCqT52CtVOhmaR6Nd-65M163g9u-&index=12 


http://ojc.asia/bbs/board.php?bo_table=LecCsharp&wr_id=433 


(동영상)C# ADO.NET 실습 ODP.NET/ODAC 설치 오라클 함수 호출 실습

(동영상)C# ADO.NET 실습 ODP.NET/ODAC 설치 오라클 함수 호출 실습ADO.NET 실습ODP.NET/ODAC 설치오라클 함수 호출 실습오라클19C, VS2022C#, ADO.NET을 이용하여 오라클 서버의 함수를 호출하는 실습을 합니다.실

ojc.asia

ADO.NET 실습

ODP.NET/ODAC 설치

오라클 함수 호출 실습


오라클19C, VS2022




C#,  ADO.NET을 이용하여 오라클 서버의 함수를 호출하는 실습을 합니다.


실습환경 : 오라클 19C, VS 2022

                 ODP.NET으로 오라클 DB의 함수를 호출하여 데이터 추출



[오라클 실습 환경 구성]


1. 오라클 전용 드라이버를 사용하기 위해 ODP.NET을 사용하려면 https://www.oracle.com/database/technologies/dotnet-odacdeploy-downloads.html 에 접속하여 ODAC 관련 ZIP 파일을 다운받아 setup.exe를 실행하여 오라클 유니버설 인스톨러를 통해 설치해야 한다. ODAC에는 오라클 접근을 위한 여러 드라이버들이 존재한다.



2. OLEDB를 사용방식으로 오라클에 접근하기 위해서는 System.Data 네임스페이스를 사용하면 되고 별다른 설치는 필요 없다.


3. VS2022에서 우리가 만드는 프로젝트를 64비트로 작동 시키기 위해 프로젝트에서 마우스 우측버튼 속성창의 빌드에서 플랫폼대상을 *64로 선택해야 한다.






[오라클 서버의 함수]

CREATE OR REPLACE FUNCTION getDept(deptno IN NUMBER)

RETURN SYS_REFCURSOR IS 

    refcur_ret SYS_REFCURSOR;

BEGIN

    OPEN refcur_ret FOR 'SELECT * FROM EMP WHERE DEPTNO = :1' using deptno;

    RETURN refcur_ret;

END getDept;


[생성함수 테스트]

variable a refcursor;

exec :a := getDept(10);

print a;


     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM     DEPTNO

---------- ---------- --------- ---------- -------- ---------- ---------- ----------


      7782 CLARK      MANAGER         7839 81/06/09       2450                    10


      7934 MILLER     CLERK           7782 82/01/23       1300                    10




[C# 콘솔 프로젝트 생성]


using System;

using System.Data;

using Oracle.DataAccess.Client;

using Oracle.DataAccess.Types;


namespace OracleTest

{

    class OracleRefCursorSample

    {

        static void Main()

        {

            //오라클 연결 문자열

            string constr = "User Id=scott;Password=tiger;Data Source=orcl";


            //오라클 Connection 생성 및 OPEN

            OracleConnection con = new OracleConnection(constr);

            con.Open();


            // 서버의 함수를 호출하기 위한 Command객체 생성(SQL실행)

            OracleCommand cmd = new OracleCommand("getDept", con);

            cmd.CommandType = CommandType.StoredProcedure;


            // Bind the parameters

            // output은 서버에서 리턴되는 참조커서를 받기위한 파라미터

            // REURN REF CURSOR bound to SELECT * FROM EMP WHERE DEPTNO = :1

            OracleParameter output = cmd.Parameters.Add("refcur_ret", OracleDbType.RefCursor);

            output.Direction = ParameterDirection.ReturnValue;


            //부서코드를 던져주기 위한 Input Parameter

            OracleParameter input = cmd.Parameters.Add("deptno", OracleDbType.Int16);

            input.Direction = ParameterDirection.Input;

            input.Value = 10;


            // 오라클 서버의 getDept함수를 호출

            cmd.ExecuteNonQuery();


            // 실행하면 참조커서가 리턴해주는 사원목록이 output 파라미터에 들어가고

            // 이를 OracleDataReader 타입으로 변환한다.

            // ADO.NET에서SELECT 목록은 Reader로 받음, 자바는 ResultSet

            OracleDataReader reader1 = ((OracleRefCursor)output.Value).GetDataReader();


            Console.Write(reader1.GetName(0) + "\t"); Console.WriteLine(reader1.GetName(1));

            Console.WriteLine("---------------------");

            while (reader1.Read())

            {

                Console.Write(reader1[0].ToString() + "\t");   Console.WriteLine(reader1[1].ToString());

            }


            reader1.Close();

            reader1.Dispose();

            output.Dispose();

            input.Dispose();

            cmd.Dispose();

            con.Close();

            con.Dispose();

        }

    }

}


[결과]


EMPNO   ENAME

---------------------

7782    CLARK

7934    MILLER


 

#시샵동영상, #ADO.NET, #닷넷오라클, #닷넷동영상, #시샵교육, #시샵학원, #ODP.NET, #ODAC, #오라클함수, #닷넷학원, #닷넷교육, 시샵동영상, ADO.NET, 닷넷오라클, 닷넷동영상, 시샵교육, 시샵학원, ODP.NET, ODAC, 오라클함수, 닷넷학원, 닷넷교육, 

2022년 3월 1일 화요일

C# 윈폼 실습교육 동영상, Winform 기반 미니 계산기, C#학원, WPF 학원, 닷넷학원교육

 

C# 윈폼 실습 Winform 기반 미니 계산기

http://ojc.asia/bbs/board.php?bo_table=LecCsharp&wr_id=432 


C# 윈폼 실습교육 동영상, Winform 기반 미니 계산기, C#학원, WPF 학원, 닷넷학원교육


(동영상)C# 윈폼, Winform 미니 계산기

(동영상)C# 윈폼, Winform 미니 계산기윈폼 실습Winform 기반 미니 계산기C# 윈폼기반 미니 계산기DataTable에서 Compute 메서드는 필터 조건에 맞는 행을 추출하여 특정컬럼을 집계(SUM, AVG, MAX, MIN, COUNT등)

ojc.asia

C# 윈폼 실습

Winform 기반 미니 계산기








C# 윈폼기반 미니 계산기



DataTable에서 Compute 메서드는 필터 조건에 맞는 행을 추출하여 특정컬럼을 집계(SUM, AVG, MAX, MIN, COUNT등)한다. 


본 계산기에서는 계산을 위한 수식을 DataTable의 Compute 메서드를 이용하여 처리한 간단한 미니 계산기를 만들어 보자.



-------------------------------------------------------

1. 디자인 코드(Form1.Designer.cs)

-------------------------------------------------------


namespace Calc

{

    partial class Form1

    {

        /// <summary>

        /// Required designer variable.

        /// </summary>

        private System.ComponentModel.IContainer components = null;



        /// <summary>

        /// Clean up any resources being used.

        /// </summary>

        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

        protected override void Dispose(bool disposing)

        {

            if (disposing && (components != null))

            {

                components.Dispose();

            }

            base.Dispose(disposing);

        }

        #region Windows Form Designer generated code

        /// <summary>

        /// Required method for Designer support - do not modify

        /// the contents of this method with the code editor.

        /// </summary>

        private void InitializeComponent()

        {

            this.textBox1 = new System.Windows.Forms.TextBox();

            this.btnC = new System.Windows.Forms.Button();

            this.btnPow = new System.Windows.Forms.Button();

            this.btnback = new System.Windows.Forms.Button();

            this.btnminus = new System.Windows.Forms.Button();

            this.btnplus = new System.Windows.Forms.Button();

            this.btnthree = new System.Windows.Forms.Button();

            this.btntwo = new System.Windows.Forms.Button();

            this.btnone = new System.Windows.Forms.Button();

            this.btndivide = new System.Windows.Forms.Button();

            this.btnnine = new System.Windows.Forms.Button();

            this.btneight = new System.Windows.Forms.Button();

            this.btnseven = new System.Windows.Forms.Button();

            this.btnmultiply = new System.Windows.Forms.Button();

            this.btnsix = new System.Windows.Forms.Button();

            this.btfive = new System.Windows.Forms.Button();

            this.btnfour = new System.Windows.Forms.Button();

            this.btnzero = new System.Windows.Forms.Button();

            this.btnequal = new System.Windows.Forms.Button();

            this.btnperiod = new System.Windows.Forms.Button();

            this.btnroot = new System.Windows.Forms.Button();

            this.SuspendLayout();

            // 

            // textBox1

            // 

            this.textBox1.Location = new System.Drawing.Point(26, 17);

            this.textBox1.Name = "textBox1";

            this.textBox1.Size = new System.Drawing.Size(286, 21);

            this.textBox1.TabIndex = 0;

            // 

            // btnC

            // 

            this.btnC.Location = new System.Drawing.Point(28, 62);

            this.btnC.Name = "btnC";

            this.btnC.Size = new System.Drawing.Size(57, 37);

            this.btnC.TabIndex = 1;

            this.btnC.Text = "C";

            this.btnC.UseVisualStyleBackColor = true;

            this.btnC.Click += new System.EventHandler(this.btnC_Click);

            // 

            // btnPow

            // 

            this.btnPow.Location = new System.Drawing.Point(255, 272);

            this.btnPow.Name = "btnPow";

            this.btnPow.Size = new System.Drawing.Size(57, 37);

            this.btnPow.TabIndex = 2;

            this.btnPow.Text = "Pow";

            this.btnPow.UseVisualStyleBackColor = true;

            this.btnPow.Click += new System.EventHandler(this.btnPow_Click);

            // 

            // btnback

            // 

            this.btnback.Location = new System.Drawing.Point(104, 62);

            this.btnback.Name = "btnback";

            this.btnback.Size = new System.Drawing.Size(57, 37);

            this.btnback.TabIndex = 3;

            this.btnback.Text = "<--";

            this.btnback.UseVisualStyleBackColor = true;

            this.btnback.Click += new System.EventHandler(this.btnback_Click);

            // 

            // btnminus

            // 

            this.btnminus.Location = new System.Drawing.Point(257, 62);

            this.btnminus.Name = "btnminus";

            this.btnminus.Size = new System.Drawing.Size(57, 37);

            this.btnminus.TabIndex = 4;

            this.btnminus.Text = "-";

            this.btnminus.UseVisualStyleBackColor = true;

            this.btnminus.Click += new System.EventHandler(this.btnminus_Click);

            // 

            // btnplus

            // 

            this.btnplus.Location = new System.Drawing.Point(178, 62);

            this.btnplus.Name = "btnplus";

            this.btnplus.Size = new System.Drawing.Size(57, 37);

            this.btnplus.TabIndex = 8;

            this.btnplus.Text = "+";

            this.btnplus.UseVisualStyleBackColor = true;

            this.btnplus.Click += new System.EventHandler(this.btnplus_Click);

            // 

            // btnthree

            // 

            this.btnthree.Location = new System.Drawing.Point(178, 115);

            this.btnthree.Name = "btnthree";

            this.btnthree.Size = new System.Drawing.Size(57, 37);

            this.btnthree.TabIndex = 7;

            this.btnthree.Text = "3";

            this.btnthree.UseVisualStyleBackColor = true;

            this.btnthree.Click += new System.EventHandler(this.btnthree_Click);

            // 

            // btntwo

            // 

            this.btntwo.Location = new System.Drawing.Point(104, 115);

            this.btntwo.Name = "btntwo";

            this.btntwo.Size = new System.Drawing.Size(57, 37);

            this.btntwo.TabIndex = 6;

            this.btntwo.Text = "2";

            this.btntwo.UseVisualStyleBackColor = true;

            this.btntwo.Click += new System.EventHandler(this.bttntwo_Click);

            // 

            // btnone

            // 

            this.btnone.Location = new System.Drawing.Point(28, 115);

            this.btnone.Name = "btnone";

            this.btnone.Size = new System.Drawing.Size(57, 37);

            this.btnone.TabIndex = 5;

            this.btnone.Text = "1";

            this.btnone.UseVisualStyleBackColor = true;

            this.btnone.Click += new System.EventHandler(this.btnone_Click);

            // 

            // btndivide

            // 

            this.btndivide.Location = new System.Drawing.Point(255, 165);

            this.btndivide.Name = "btndivide";

            this.btndivide.Size = new System.Drawing.Size(57, 37);

            this.btndivide.TabIndex = 16;

            this.btndivide.Text = "/";

            this.btndivide.UseVisualStyleBackColor = true;

            this.btndivide.Click += new System.EventHandler(this.btndivide_Click);

            // 

            // btnnine

            // 

            this.btnnine.Location = new System.Drawing.Point(178, 218);

            this.btnnine.Name = "btnnine";

            this.btnnine.Size = new System.Drawing.Size(57, 37);

            this.btnnine.TabIndex = 15;

            this.btnnine.Text = "9";

            this.btnnine.UseVisualStyleBackColor = true;

            this.btnnine.Click += new System.EventHandler(this.btnnine_Click);

            // 

            // btneight

            // 

            this.btneight.Location = new System.Drawing.Point(104, 218);

            this.btneight.Name = "btneight";

            this.btneight.Size = new System.Drawing.Size(57, 37);

            this.btneight.TabIndex = 14;

            this.btneight.Text = "8";

            this.btneight.UseVisualStyleBackColor = true;

            this.btneight.Click += new System.EventHandler(this.btneight_Click);

            // 

            // btnseven

            // 

            this.btnseven.Location = new System.Drawing.Point(28, 218);

            this.btnseven.Name = "btnseven";

            this.btnseven.Size = new System.Drawing.Size(57, 37);

            this.btnseven.TabIndex = 13;

            this.btnseven.Text = "7";

            this.btnseven.UseVisualStyleBackColor = true;

            this.btnseven.Click += new System.EventHandler(this.btnseven_Click);

            // 

            // btnmultiply

            // 

            this.btnmultiply.Location = new System.Drawing.Point(255, 115);

            this.btnmultiply.Name = "btnmultiply";

            this.btnmultiply.Size = new System.Drawing.Size(57, 37);

            this.btnmultiply.TabIndex = 12;

            this.btnmultiply.Text = "*";

            this.btnmultiply.UseVisualStyleBackColor = true;

            this.btnmultiply.Click += new System.EventHandler(this.btnmultiply_Click);

            // 

            // btnsix

            // 

            this.btnsix.Location = new System.Drawing.Point(178, 165);

            this.btnsix.Name = "btnsix";

            this.btnsix.Size = new System.Drawing.Size(57, 37);

            this.btnsix.TabIndex = 11;

            this.btnsix.Text = "6";

            this.btnsix.UseVisualStyleBackColor = true;

            this.btnsix.Click += new System.EventHandler(this.btnsix_Click);

            // 

            // btfive

            // 

            this.btfive.Location = new System.Drawing.Point(104, 165);

            this.btfive.Name = "btfive";

            this.btfive.Size = new System.Drawing.Size(57, 37);

            this.btfive.TabIndex = 10;

            this.btfive.Text = "5";

            this.btfive.UseVisualStyleBackColor = true;

            this.btfive.Click += new System.EventHandler(this.btnfive_Click);

            // 

            // btnfour

            // 

            this.btnfour.Location = new System.Drawing.Point(28, 165);

            this.btnfour.Name = "btnfour";

            this.btnfour.Size = new System.Drawing.Size(57, 37);

            this.btnfour.TabIndex = 9;

            this.btnfour.Text = "4";

            this.btnfour.UseVisualStyleBackColor = true;

            this.btnfour.Click += new System.EventHandler(this.btnfour_Click);

            // 

            // btnzero

            // 

            this.btnzero.Location = new System.Drawing.Point(28, 271);

            this.btnzero.Name = "btnzero";

            this.btnzero.Size = new System.Drawing.Size(57, 37);

            this.btnzero.TabIndex = 17;

            this.btnzero.Text = "0";

            this.btnzero.UseVisualStyleBackColor = true;

            this.btnzero.Click += new System.EventHandler(this.btnzero_Click);

            // 

            // btnequal

            // 

            this.btnequal.Location = new System.Drawing.Point(178, 271);

            this.btnequal.Name = "btnequal";

            this.btnequal.Size = new System.Drawing.Size(57, 37);

            this.btnequal.TabIndex = 19;

            this.btnequal.Text = "=";

            this.btnequal.UseVisualStyleBackColor = true;

            this.btnequal.Click += new System.EventHandler(this.btnequal_Click);

            // 

            // btnperiod

            // 

            this.btnperiod.Location = new System.Drawing.Point(104, 271);

            this.btnperiod.Name = "btnperiod";

            this.btnperiod.Size = new System.Drawing.Size(57, 37);

            this.btnperiod.TabIndex = 18;

            this.btnperiod.Text = ".";

            this.btnperiod.UseVisualStyleBackColor = true;

            this.btnperiod.Click += new System.EventHandler(this.btnperiod_Click);

            // 

            // btnroot

            // 

            this.btnroot.Location = new System.Drawing.Point(255, 218);

            this.btnroot.Name = "btnroot";

            this.btnroot.Size = new System.Drawing.Size(57, 37);

            this.btnroot.TabIndex = 20;

            this.btnroot.Text = "√";

            this.btnroot.UseVisualStyleBackColor = true;

            this.btnroot.Click += new System.EventHandler(this.btnroot_Click);

            // 

            // Form1

            // 

            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);

            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;


            this.ClientSize = new System.Drawing.Size(333, 335);

            this.Controls.Add(this.btnroot);

            this.Controls.Add(this.btnequal);

            this.Controls.Add(this.btnperiod);

            this.Controls.Add(this.btnzero);

            this.Controls.Add(this.btndivide);

            this.Controls.Add(this.btnnine);

            this.Controls.Add(this.btneight);

            this.Controls.Add(this.btnseven);

            this.Controls.Add(this.btnmultiply);

            this.Controls.Add(this.btnsix);

            this.Controls.Add(this.btfive);

            this.Controls.Add(this.btnfour);

            this.Controls.Add(this.btnplus);

            this.Controls.Add(this.btnthree);

            this.Controls.Add(this.btntwo);

            this.Controls.Add(this.btnone);

            this.Controls.Add(this.btnminus);

            this.Controls.Add(this.btnback);

            this.Controls.Add(this.btnPow);

            this.Controls.Add(this.btnC);

            this.Controls.Add(this.textBox1);

            this.Name = "Form1";

            this.Text = "미니계산기";

            this.ResumeLayout(false);

            this.PerformLayout();


        }

        #endregion

        private System.Windows.Forms.TextBox textBox1;

        private System.Windows.Forms.Button btnC;

        private System.Windows.Forms.Button btnPow;

        private System.Windows.Forms.Button btnback;

        private System.Windows.Forms.Button btnminus;

        private System.Windows.Forms.Button btnplus;

        private System.Windows.Forms.Button btnthree;

        private System.Windows.Forms.Button btntwo;

        private System.Windows.Forms.Button btnone;

        private System.Windows.Forms.Button btndivide;

        private System.Windows.Forms.Button btnnine;

        private System.Windows.Forms.Button btneight;

        private System.Windows.Forms.Button btnseven;

        private System.Windows.Forms.Button btnmultiply;

        private System.Windows.Forms.Button btnsix;

        private System.Windows.Forms.Button btfive;

        private System.Windows.Forms.Button btnfour;

        private System.Windows.Forms.Button btnzero;

        private System.Windows.Forms.Button btnequal;

        private System.Windows.Forms.Button btnperiod;

        private System.Windows.Forms.Button btnroot;

    }

}




-------------------------------------------------------

2. C# 소스코드(Form1.cs)

-------------------------------------------------------



using System;

using System.Data;

using System.Windows.Forms;

namespace Calc

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        //----------------------------------------------------

        // 모든 계산 Clear

        //----------------------------------------------------

        private void btnC_Click(object sender, EventArgs e)

        {

            textBox1.Clear();

        }


        //----------------------------------------------------

        // BACK 버튼 클릭(맨 오른쪽 숫자 제거)

        //----------------------------------------------------

        private void btnback_Click(object sender, EventArgs e)

        {

            if (textBox1.Text.Length > 0)

            {

                string text = textBox1.Text;

                textBox1.Text = text.Substring(0, text.Length - 1);

            }

        }


        //----------------------------------------------------

        // 마이너스(-) 버튼 클릭

        //----------------------------------------------------

        private void btnminus_Click(object sender, EventArgs e)

        {

            textBox1.Text += "-";

        }


        //----------------------------------------------------

        // 1 버튼 클릭

        //----------------------------------------------------

        private void btnone_Click(object sender, EventArgs e)

        {

            textBox1.Text += "1";

        }


        //----------------------------------------------------

        // 2 버튼 클릭

        //----------------------------------------------------

        private void bttntwo_Click(object sender, EventArgs e)

        {

            textBox1.Text += "2";

        }


        //----------------------------------------------------

        // 3 버튼 클릭

        //----------------------------------------------------

        private void btnthree_Click(object sender, EventArgs e)

        {

            textBox1.Text += "3";

        }


        //----------------------------------------------------

        // 더하기(+) 버튼 클릭

        //----------------------------------------------------

        private void btnplus_Click(object sender, EventArgs e)

        {

            textBox1.Text += "+";

        }


        //----------------------------------------------------

        // 4 버튼 클릭

        //----------------------------------------------------

        private void btnfour_Click(object sender, EventArgs e)

        {

            textBox1.Text += "4";

        }


        //----------------------------------------------------

        // 5 버튼 클릭

        //----------------------------------------------------

        private void btnfive_Click(object sender, EventArgs e)

        {

            textBox1.Text += "5";

        }


        //----------------------------------------------------

        // 6 버튼 클릭

        //----------------------------------------------------

        private void btnsix_Click(object sender, EventArgs e)

        {

            textBox1.Text += "6";

        }


        //----------------------------------------------------

        // 곱하기 버튼 클릭

        //----------------------------------------------------

        private void btnmultiply_Click(object sender, EventArgs e)

        {

            textBox1.Text += "*";

        }


        //----------------------------------------------------

        // 7 버튼 클릭

        //----------------------------------------------------

        private void btnseven_Click(object sender, EventArgs e)

        {

            textBox1.Text += "7";

        }


        //----------------------------------------------------

        // 8 버튼 클릭

        //----------------------------------------------------

        private void btneight_Click(object sender, EventArgs e)

        {

            textBox1.Text += "8";

        }


        //----------------------------------------------------

        // 9 버튼 클릭

        //----------------------------------------------------

        private void btnnine_Click(object sender, EventArgs e)

        {

            textBox1.Text += "9";

        }


        //----------------------------------------------------

        // 나누기 버튼 클릭

        //----------------------------------------------------

        private void btndivide_Click(object sender, EventArgs e)

        {

            textBox1.Text += "/";

        }


        //----------------------------------------------------

        // 0 버튼 클릭

        //----------------------------------------------------

        private void btnzero_Click(object sender, EventArgs e)

        {

            textBox1.Text += "0";

        }


        //----------------------------------------------------

        // 쩜(.) 버튼 클릭

        //----------------------------------------------------

        private void btnperiod_Click(object sender, EventArgs e)

        {

            string str = textBox1.Text.ToString();

            int len = str.Length;


            if (textBox1.Text[--len] != '.')

            {

                textBox1.Text += ".";

            }

        }


        //----------------------------------------------------

        // 등호(=) 버튼 클릭

        //----------------------------------------------------

        private void btnequal_Click(object sender, EventArgs e)

        {

            try

            {

                //DataTable의 Compute메서드는 지정된 식을 계산한다.

                //두번째 인자는 필터조건이며 본 예제에서는 필요없다.

                //원래 DataTable에서 Compute는 필터 조건에 맞는 행을 추출하여

                //특정컬럼을 집계한다. SUM, AVG, MAX, MIN, COUNT등

                DataTable dt = new DataTable();

                var a = dt.Compute(textBox1.Text, "");


                textBox1.Text = a.ToString();

            }

            catch (Exception e1)

            {

                MessageBox.Show(e1.Message);

            }

        }


        //----------------------------------------------------

        // 루트 버튼 클릭

        //----------------------------------------------------

        private void btnroot_Click(object sender, EventArgs e)

        {

            try

            {

                double a = Math.Sqrt(Double.Parse(textBox1.Text));

                textBox1.Text = a.ToString();

            }

            catch (Exception e1)

            {

                MessageBox.Show(e1.Message);

            }

        }


        //----------------------------------------------------

        // POW 버튼 클릭

        //----------------------------------------------------

        private void btnPow_Click(object sender, EventArgs e)

        {

            try

            {

                double a = Math.Pow(Double.Parse(textBox1.Text), 2);

                textBox1.Text = a.ToString();

            }

            catch (Exception e1)

            {

                MessageBox.Show(e1.Message);

            }

        }

    }

}



#윈폼, #윈폼계산기, #Winform, #시샵계산기, #Windform계산기, #닷넷계산기, #시샵동영상, #시샵교육, #닷넷교육, #닷넷동영상,윈폼, 윈폼계산기, Winform, 시샵계산기, Windform계산기, 닷넷계산기, 시샵동영상, 시샵교육, 닷넷교육, 닷넷동영상, 

(C#교육동영상)C# ADO.NET 실습 ODP.NET/ODAC 설치 오라클 함수 호출 실습, C#학원, WPF학원, 닷넷학원, 자바학원

  (C#교육동영상)C# ADO.NET 실습  ODP.NET/ODAC 설치  오라클 함수 호출 실습, C#학원, WPF학원, 닷넷학원, 자바학원 https://www.youtube.com/watch?v=qIPU85yAlzc&list=PLxU-i...