PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET DataAdapter.Update not working

Reply

DataAdapter.Update not working

 
Thread Tools Rate Thread
Old 08-02-2006, 05:31 AM   #1
Craig Hoy
Guest
 
Posts: n/a
Default DataAdapter.Update not working


I have been trying to get DataAdapter.Update(DataSet) to update a SQL
Server database. I have not been getting any errors but there is no
records in the database when I check Enterprise Manager.

Could someone please help!

*** Sent via Developersdex http://www.developersdex.com ***
  Reply With Quote
Old 08-02-2006, 06:52 AM   #2
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: DataAdapter.Update not working

Craig,

There are so many posibilities for your error, can you tell us a little bit
more. Did you use the designer, did you use a commandbuilder, did you write
the commands yourself, etc.

Cor


  Reply With Quote
Old 08-02-2006, 07:40 AM   #3
Terry Burns
Guest
 
Posts: n/a
Default Re: DataAdapter.Update not working

Hi Cor,

Long time no see !, how are you these days ?

Terry Burns
http://TrainingOn.net



"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:%23NvfRwHLGHA.500@TK2MSFTNGP15.phx.gbl...
> Craig,
>
> There are so many posibilities for your error, can you tell us a little
> bit more. Did you use the designer, did you use a commandbuilder, did you
> write the commands yourself, etc.
>
> Cor
>



  Reply With Quote
Old 08-02-2006, 09:20 PM   #4
W.G. Ryan - MVP
Guest
 
Posts: n/a
Default Re: DataAdapter.Update not working


"Craig Hoy" <craigh@omnilink.com.au> wrote in message
news:egf1uDHLGHA.3944@tk2msftngp13.phx.gbl...
>I have been trying to get DataAdapter.Update(DataSet) to update a SQL
> Server database. I have not been getting any errors but there is no
> records in the database when I check Enterprise Manager.
>
> Could someone please help!

--Craig, two things come to mind. First, make sure that
yourdataSet.HasChanges(); if not , then nothing is going to happen with
your update. http://www.knowdotnet.com/articles/rowstateupdate.html . If you
don't have Changes then there's nothing for the adapter to update. Next, if
that's not the case, run Sql Profiler and call Update and verify what's
being sent to the db. That should shed some insight into the problem.
>
> *** Sent via Developersdex http://www.developersdex.com ***



  Reply With Quote
Old 09-02-2006, 02:20 AM   #5
Val Mazur \(MVP\)
Guest
 
Posts: n/a
Default Re: DataAdapter.Update not working

Craig,

If no error, then most likely DataAdapter does not have anything to update
in a database. If you know for sure that you have made the changes in a
database, then make sure that your code does not call AcceptChanges \before
it calls Update. Also make sure that UPDATE statements or SP that does
updating has proper conditions for the WHERE clause, if it has any

Val Mazur
Microsoft MVP
http://xport.mvps.org


"Craig Hoy" <craigh@omnilink.com.au> wrote in message
news:egf1uDHLGHA.3944@tk2msftngp13.phx.gbl...
>I have been trying to get DataAdapter.Update(DataSet) to update a SQL
> Server database. I have not been getting any errors but there is no
> records in the database when I check Enterprise Manager.
>
> Could someone please help!
>
> *** Sent via Developersdex http://www.developersdex.com ***



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off