Connect to database .NET 3.0

  • Thread starter Thread starter bla
  • Start date Start date
B

bla

How to connect to database in .NET 3.0
There is no binding source and datasets in toolbox.
 
Hi, maybe this hepls you:

OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = connectionString;
connection.Open();
OleDbCommand cmd = new OleDbCommand();
String query;
query = "select * from typetable";
cmd.CommandText = query;
cmd.Connection = connection;
cmd.ExecuteNonQuery();
OleDbDataReader rdr = cmd.ExecuteReader();
//Keep reading records in the forward direction
while (rdr.Read())
{

MessageBox(rdr[1].ToString());


}
 
Create them in code.

BindingSource myBindingSource = new BindingSource();

Robin S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top