Re: Datagrid doesn't update
From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 04/27/04
- Next message: William Ryan eMVP: "Re: Navigation in Datagrid"
- Previous message: Wanda: "Datagrid doesn't update"
- In reply to: Wanda: "Datagrid doesn't update"
- Next in thread: Wanda Li: "Re: Datagrid doesn't update"
- Reply: Wanda Li: "Re: Datagrid doesn't update"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 15:48:30 -0400
Are you sure your dataset .HasChanges before calling update? IF not, calling
update all year won't do anything. And DO NOT CALL acceptchanges before the
update. This will essentially return the rowstates of everything back to
Unchanged and it will physically delete rows marked as Deleted. If you call
AcceptChanges before Update, your DB will never be updated.
ALso, are you getting an exception on update? Make sure it's not wrapped in
try catch with no action being taken...that can mask errors.
If HasChanges is true, your update command is valid you should be able to
update. If no exceptions are thrown, you have a weird problem indeed, but I
don't think it's that.
Let me know.
"Wanda" <wandali@rogers.com> wrote in message
news:11ac19d1.0404271137.2fdc0a18@posting.google.com...
> I am using vb.net and have a bounded datagrid by using SQLDataAdaptor
> and SQLDataSet, it does show the data when it is first loaded. But
> when I change the data on the datagrid, it doesn't update the
> database, even I use AcceptChanges...
>
> What am I missing? What I am expecting is it should update the
> database automatically without doing it manually with the code.
>
> Please help!!!!
>
> Thanks in advance.
> Wanda
- Next message: William Ryan eMVP: "Re: Navigation in Datagrid"
- Previous message: Wanda: "Datagrid doesn't update"
- In reply to: Wanda: "Datagrid doesn't update"
- Next in thread: Wanda Li: "Re: Datagrid doesn't update"
- Reply: Wanda Li: "Re: Datagrid doesn't update"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|