954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Table Control, wats wrong

OleDbConnection cn = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\\tblImp\\db1.mdb");
cn.Open();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter("select * from tblImp", cn);
da.Fill(ds, "tblImp");
tablecontrol.datasource() = ds.Tables[0];
tablecontrol.DataBind();

table is not populated with data from access database.
help me plz.

ansari.wajid
Light Poster
47 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

first, run your program in debug mode.

You need to insert a breakpoint at cn.Open and F11 through step by step.

Why? To see if the connection has even been made properly. I dont seen an InitialCatalog value for your connection string. This might need addending as well.

jonathan.pucket
Newbie Poster
3 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

hi,
i am a beginner in asp.net. wat to do to populate table control from access database. above code is not workin. problem is in bindin data with table control. how to bind data to table control.
thanks for help.

ansari.wajid
Light Poster
47 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You