Answered by:
oracle - how to connect

Question
-
i have an exercise that write an application that interact to oracle DB. i know c# language and used to work with MS SQL. can you tell me how to connect to oracle server and what are differences of oracle and MS SQL. thanks.
mtdSaturday, May 23, 2009 3:16 PM
Answers
-
I dont think the difference between oracle and ms sql is in scope of this forum.
Connecting to oracle
const string strConn = "Provider=MSDAORA.1;Data Source=oracle_db;User ID=scott;Password=tiger";
const string strSQL = "Select * From EMP";
try {
DataSet ds = new DataSet("EmployeesSet");
ADODataSetCommand myCommand = new ADODataSetCommand(strSQL,strConn);
myCommand.FillDataSet(ds,"Buyer");
Console.WriteLine(ds.Xml);
}
catch (ADOException e) {
Console.WriteLine("Exception Occured :{0}",e.Errors[0].Message);
}
Thanks,
A.m.a.L
.Net GoodiesRemember to click "mark as answered" when you get a correct reply to your question - Marked as answer by middlecowboy Saturday, May 23, 2009 6:30 PM
Saturday, May 23, 2009 4:24 PM
All replies
-
I dont think the difference between oracle and ms sql is in scope of this forum.
Connecting to oracle
const string strConn = "Provider=MSDAORA.1;Data Source=oracle_db;User ID=scott;Password=tiger";
const string strSQL = "Select * From EMP";
try {
DataSet ds = new DataSet("EmployeesSet");
ADODataSetCommand myCommand = new ADODataSetCommand(strSQL,strConn);
myCommand.FillDataSet(ds,"Buyer");
Console.WriteLine(ds.Xml);
}
catch (ADOException e) {
Console.WriteLine("Exception Occured :{0}",e.Errors[0].Message);
}
Thanks,
A.m.a.L
.Net GoodiesRemember to click "mark as answered" when you get a correct reply to your question - Marked as answer by middlecowboy Saturday, May 23, 2009 6:30 PM
Saturday, May 23, 2009 4:24 PM -
-
You can make use of the Oracle Client. It might not appear by default and you have to add reference to System.Data.OracleClient dll to access it
Ganesh Ranganathan
[Please mark the post as answer if you find it helpful]- Proposed as answer by kmmohd_anwar Sunday, May 24, 2009 7:40 AM
Saturday, May 23, 2009 8:32 PM