winforms - Searching for Microsoft Access records in a C# Windows Forms application? -


how search microsoft access record in c# windows forms application?

code:

    private void btnsearch_click(object sender, eventargs e)     {         dataadapter = new oledbdataadapter("select *  tblstudents studid='" +                                               txtstudid.text + "' ",                                            conn);         dataset = new dataset();          dataadapter.fill(dataset);         datagridview1.datasource = dataset.tables[0];     } 

//bindingsource sync datatable , datagridview bindingsource bsource = new bindingsource();  //set bindingsource datasource bsource.datasource = ds.tables[0];  //set datagridview datasource datagridview1.datasource = bsource; 

to changes database, have call update() of oledbdataadapter datatable argument accomplish this.

da.update(ds.tables[0]); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -