Answers for "conncet oracle database in c# visual studio"

C#
0

conncet oracle database in c# visual studio

string oradb = "Data Source=ORCL;User Id=hr;Password=hr;";
OracleConnection conn = new OracleConnection(oradb);  // C#
conn.Open(); 
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "select department_name from departments where department_id = 10";
cmd.CommandType = CommandType.Text; 
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
label1.Text = dr.GetString(0);
conn.Dispose();
Posted by: Guest on August-11-2021

C# Answers by Framework

Browse Popular Code Answers by Language