How to get oledb connection?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you connect to database using .NET?

810


What is ado oledb and odbc?

705


What is ado net stands for?

726


What are the classes in System.Data.Common Namespace?

913


What are the advantages of using datalist?

725


How to perform sorting on a table in ADO.NET?

783


What are datareaders?

704


How do I delete a row from a DataTable?

807


Explain advantages of ado.net?

827


Why is ADO.NET serialization slower than ADO ?

835


What is bubbled event?

736


What are the different ado.net namespaces?

855


What is ado.net objects?

725


Explain the advantage of ADO.Net?

767


What connected data?

704