c# - Troubles with Insert / Update Methods of DataSet provider for DataGrid -
i've used wizard assert datagrid mssql table using dataset provider / binding
dataset model got table select / insert / update methods looking don't appear or don't work. can add / update data datagrid no changes in mssql appears.
so here code generated wizards designers :
this.alarmview.datasource = this.alarmdictionarybindingsource;
// // alarmdictionarybindingsource // this.alarmdictionarybindingsource.datamember = "alarmdictionary"; this.alarmdictionarybindingsource.datasource = this.friibdataset; // // friibdataset // this.friibdataset.datasetname = "friibdataset"; this.friibdataset.schemaserializationmode = system.data.schemaserializationmode.includeschema; // // datagridviewtextboxcolumn1 // this.datagridviewtextboxcolumn1.datapropertyname = "id"; this.datagridviewtextboxcolumn1.headertext = "id"; this.datagridviewtextboxcolumn1.name = "datagridviewtextboxcolumn1"; // // datagridviewtextboxcolumn2 // this.datagridviewtextboxcolumn2.datapropertyname = "message"; this.datagridviewtextboxcolumn2.headertext = "message"; this.datagridviewtextboxcolumn2.maxinputlength = 255; this.datagridviewtextboxcolumn2.name = "datagridviewtextboxcolumn2"; this.datagridviewtextboxcolumn2.width = 255;
table adapter wizard said it's generated methods : insert , update etc ... still can't submit changes mssql ... else need ?
that easy question can't understand why simple things don't work simply... share necessary information fix mess.
i added update method table manually because wizard lied me not created , code :
private void alarmview_cellendedit(object sender, datagridviewcelleventargs e) { alarmdictionarytableadapter.update(friibdataset.alarmdictionary); }
works , if need add new or delete , must process alike ?
i hope there more easy way make it.
try commiting changes have made using acceptchanges method of dataset.
here link
Comments
Post a Comment