Re: Update Database from DataAdapter

From: Val Mazur (group51a_at_hotmail.com)
Date: 09/24/04


Date: Thu, 23 Sep 2004 22:15:43 -0400

Hi,

Calling Update should do this, but in a case of your DataSet was populated
using Dataadapter (DA). In a case if your dataSet fall fabricated, then DA
will not know anything about underlying database. Another potential issue is
the you call AcceptChanges before calling Update method of DA. In this case
AcceptChanges will reset state of the rows to unmodified and DA will not see
any changes in a DataSet.

-- 
Val Mazur
Microsoft MVP
"Strider" <Strider@discussions.microsoft.com> wrote in message 
news:C934CEFE-DC65-43DA-B1B5-4B6E242E4715@microsoft.com...
> Hey,
> here is my problem. I have a dataSet which contains data that i want to 
> add
> to my database. But i dont know how to update the dataadapter with the
> dataset.
> i've tried da.update(ds,tableName) but it does not update it.
>
> can anyone help
>
> Cheers 


Relevant Pages

  • Re: Ado type updates in Ado.net
    ... > data and then calling Update() on the DataAdapter. ... SqlConnection conn = new SqlConnection; ... // yadda yadda yadda:) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Update Database from DataAdapter
    ... This code does not populate the DataAdapter with action queries ... >> will not know anything about underlying database. ... >> the you call AcceptChanges before calling Update method of DA. ...
    (microsoft.public.data.ado)
  • Re: Datagrid doesnt update
    ... Are you sure your dataset .HasChanges before calling update? ... AcceptChanges before Update, your DB will never be updated. ... > I am using vb.net and have a bounded datagrid by using SQLDataAdaptor ...
    (microsoft.public.dotnet.languages.vb)