>//show data > >cn = new MySqlConnection(mmyclass1.readMySqlConnString); >cn.Open(); >ds = new DataSet(); >string msqlselect = "select * from da where hostid = " + mhostid + " and ano = '" + pano + "'"; >da = new MySqlDataAdapter(msqlselect, cn); >da.SelectCommand.CommandText = msqlselect; >ds.Clear(); >da.Fill(this.ds); >daTable = this.ds.Tables[0]; >mmyclass1.BindField(this.textBox1, "Text", daTable, "ades"); >mmyclass1.BindField(this.checkBox1, "Checked", daTable, "hda"); >mmyclass1.BindField(this.comboBox3, "SelectedIndex", daTable, "atype"); >mmyclass1.BindField(this.textBox2, "Text", daTable, "adelay"); > >//save > >if (cn.State == ConnectionState.Closed) >{ >cn = new MySqlConnection(mmyclass1.readMySqlConnString); >cn.Open(); >} >MySqlCommandBuilder cb = new MySqlCommandBuilder(da); >cb.ReturnGeneratedIdentifiers = false; >cb.GetInsertCommand(); >cb.GetUpdateCommand(); >da.Update(daTable); >ds.AcceptChanges(); > >I'm rusty on this but shouldn't you be setting the commands on the DataAdapter rather than the CommandBuilder?