How to get oledb connection?

Answers were Sorted based on User's Feedback



How to get oledb connection?..

Answer / senthil kumar

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");

i hope that these are enough.

Is This Answer Correct ?    4 Yes 1 No

How to get oledb connection?..

Answer / guest

oledb provid universal connection strintg .using oledb we
can conntect to any data base.

Is This Answer Correct ?    2 Yes 2 No

How to get oledb connection?..

Answer / jnan

using system.data.oledb

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ADO.NET Interview Questions

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

5 Answers   IBM, Veegyapan Impacts,


What does ado stand for in ado.net?

0 Answers  


How can we serialize the dataset object?

0 Answers  


What is ado and dao?

0 Answers  


What are the advantages and drawbacks of using ado.net?

0 Answers  


What is ole access?

0 Answers  


OleDbDataAdapter ole=new OleDbDataAdapter(new OleDbCommand ("select * from login",oleDbConnection1)); OleDbCommandBuilder cmd=new OleDbCommandBuilder(ole); ole.Fill(dataSet11,"login"); DataRow drow=dataSet11.Tables ["login"].NewRow(); drow[0]=textBox1.Text; drow[1]=textBox2.Text; drow[2]=textBox3.Text; dataSet11.Tables["login"].Rows.Add (drow); ole.UpdateCommand=cmd.GetUpdateCommand(); ole.Update(dataSet11,"login"); MessageBox.Show("one row added"); this gives exception.how to solve it

1 Answers   Nimaya,


Define data adapter?

0 Answers  


Define Execute Reader?

0 Answers  


What is an orm, and why would you use one instead of plain old ado.net?

0 Answers  


If we want to connect to many databases in dataaccess layer such as MSAccess,Sql server,oracle means not to a particular database depends on condition we have to connect to appropriate database in this scenario if we without changing code Ho wdo you handle this situation?

4 Answers   Honeywell,


What is ado.net explain with diagram?

0 Answers  


Categories