how to bind the data grid view in windows application

Apr 18 2009 9:10 AM

Hi.

iam using system.data.oledb;

//My code is

OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\db1.mdb");

//try

//{

aConnection.Open();

string strsql = "select * from ParentDetails";

OleDbCommand aCommand = new OleDbCommand(strsql, aConnection);

OleDbDataAdapter da = new OleDbDataAdapter(aCommand);

DataSet ds = new DataSet();

da.Fill(ds);

dataGridView1.DataSource = ds;

dataGridView1.bi          //Here Iam not getting the daraGridview 1.DataBind();

aConnection.Close();

 

so tell me how to bind the data is there an y other syntax


Answers (1)