Thanks!
I made up the UpdateCommand, InsertCommand, DeleteCommand for
MySqlDataAdapter.
And it worked fine with the Insert and Update.
When I delete a row form the DataGrid, that row will be deleted but it pops
out a message with System.Data.RowNotInTableException.
How do I solve this problem.
Thanks for help.
Jason
"Galcho[MCSD.NET]" <(E-Mail Removed)>
???????:(E-Mail Removed)...
> could you be more specific about exception you get.
>
> why do you exctract changes from datatset? DataAdapater does this for
> you as it calls respectively UpdateCommand, Insertcommand and
> Deletecommand for each changed, inserted or deleted row.
>
> just call mySqlDataAdapter.Update(myDataSet);
>
> hope this helps
> Galin Iliev[MCSD.NET]
> www.galcho.com
>
> Jason Huang wrote:
>> Hi,
>>
>> In my .Net 1.1 C# winodows form project,
>> I use the following code trying to update data via a DataGrid.
>>
>> private void UpdateDataSet(DataSet myDataSet){
>> if(!myDataSet.HasChanges(DataRowState.Modified)) return;
>> DataSet xDataSet;
>> xDataSet = myDataSet.GetChanges(DataRowState.Modified);
>> if(xDataSet.HasErrors){ }
>> mySqlDataAdapter.Update(xDataSet);
>> }
>>
>> private void btnSave_Click(object sender, System.EventArgs e)
>> {
>> this.UpdateDataSet(myGridDS);
>> }
>>
>> However, it comes out with an error message saying something wrong with
>> the
>> modified DataRow and UpdateCommand.
>> Would someone tell me how to fix it?
>> Thanks for help.
>>
>>
>> Jason
>