How to get the new oledb connection of oracle in database
programming?



How to get the new oledb connection of oracle in database programming?..

Answer / srikant dwibedi

using OLEDB connection we can connect the MS-ACCESS,Sql
Server,Oracle.

here i given the coding for connect the oledb connection

OleDbConnection con = new OleDbConnection();
con.ConnectionString="Provider=Microsoft.Jet.OleDb.4.0;Data
Source=databasenamewithpath;";
con.Open();

then u can use the dataset or datareader
OleDbCommand cmd = new OleDbCommand(sql,con);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();


OleDbDataReader reader;
reader = cmd.ExecuteReader();


OleDbDataAdapter oda = new OleDbDataAdapter(sql,con);
DataSet ds = new DataSet();
oda.Fill(ds,"tablename");

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

Which is the best method to get two values from the database?

0 Answers  


What is difference between sqldatareader and sqldataadapter?

0 Answers  


Which method do you invoke on the DataAdapter control to load your generated dataset with data?

5 Answers   IBM, Veegyapan Impacts,


How to find the given query is optimised one or not?

0 Answers  


How do you handle data concurrency in .NET ?

9 Answers   Infogain, SunGard,






How do you update database through dataset?

0 Answers  


Explain all the classes those are used for database connections between sql server and asp.net?

0 Answers  


what is type dataset?

3 Answers  


Does ado.net use odbc?

0 Answers  


What are the benefits of ADO.NET?

0 Answers   B-Ways TecnoSoft,


When we are running the Application, if any errors occur in the Stored Procedure then how will the server identify the errors?

5 Answers   HCL,


What is an example of ordinal data?

0 Answers  


Categories