c# - Showing record(s) from DB in a datagridview -
again, have access db connected form using c#. code works ( seems ) shows first record of db, nothing more in gridview.
string connetionstring; oledbconnection connection; oledbdataadapter oledbadapter; dataset ds = new dataset(); string sql; connetionstring = @"provider=microsoft.jet.oledb.4.0;data source=z:\tempesta\area progetto\area_progetto_data_magazine\data_magazine\data_magazine\db\datamg.mdb;"; connection = new oledbconnection(connetionstring); sql = "select * prodotti"; try { connection.open(); oledbadapter = new oledbdataadapter(sql, connection); oledbadapter.fill(ds); datagridview1.datasource = ds.tables[0]; } catch (exception ex) { messagebox.show(ex.tostring()); }
whats wrong?
Comments
Post a Comment