Fahim
Answered On : Nov 7th, 2006
You can use the methodsd and function available in the System.OleDB class instead, to get the SQL connection.
Login to rate this answer.
Using System.Oledb;OledbConnection con= new OledbConnection ("Provider=SQLOLEDB.1;User Id=sa;Database=Northwind");OledbCommand cmd= new OledbCommand ("select * from table1",con);oledbdatareader dr= new oledbdatareader ();dr= cmd.ExecuteReader();datagrid1.datasource=dr;datagrid1.databind();

5 Users have rated as useful.
Login to rate this answer.
vikash agarwal
Answered On : Nov 15th, 2006
using oledbnamespacesystem.data. olebd dim con as new oledbconnection(" provider=sqloledb.1;.............. ")
Login to rate this answer.
sriraja
Answered On : Nov 19th, 2006
Hi
By oledb connection sqlclient is called connection less oriented and
oledb is called connection oriented.
Login to rate this answer.
Kamal Kant Verma
Answered On : Dec 18th, 2006
you can connect sql using oledbname space .

1 User has rated as useful.
Login to rate this answer.
We have 4 Data Providers to connect to our database:
SqlClient = Used only for Sql Server database.
OracleClient = Used only for Oracle database.
Oledb = Used for any kind of databases either new or old.
Odbc = User for older databases.
So, to connect to SQL Server Database without using sqlclient, we can use OLEDB Data Provider.
Using System.Oledb;
OledbConnection conn= new OledbConnection ("Provider=SQLOLEDB.1;User Id=sa;Database=Northwind");
OledbCommand cmd= new OledbCommand ("select * from employee", conn);
Code
Using System.Oledb;
OledbConnection conn= new OledbConnection ("Provider=SQLOLEDB.1;User Id=sa;Database=Northwind");
OledbCommand cmd= new OledbCommand ("select * from employee", conn);
Login to rate this answer.