By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

need advice on keeping ds table & db tables in synch, in a ws (if possible)

P: n/a
We have an app that queries 5 tables into a dataset. Now, lets say 1 of
those tables is about to change due to user input on a webpage. Right now,
we are manually updating the db with an update command (execute non-query)
in a web service. But now, we're not sure how to now update the table in
the ds. My thinking is requery that 1 table, grab my dataset from the
session & do sda.Fill(myDS, "tblEmployee") which will keep my existing ds,
just replacing tblEmployee.

But perhaps there's a better way to do this. It would be nice if I could
just update the dataset value from the datagrid (although that seems like a
pain to do) and just do myDS.Save( ) and it automatically know which
table(s) to update in the db so the dataset & the database are in synch.

The other request I would have is, can the above be done in a web service?
(A couple years ago I played around with dropping a dataset on a page and
strong-typing it but I didn't like that it was done on a page, and not a ws.
And if the db table structure changed the entire construct broke, which was
a pain in the neck)

Thanks for any best-of-breed advice :)


Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Jason,

If you are updating database from datatable why do you need to refresh
datatable in first place?
You need to retrieve the autoinc field or something like that?
If this is the case, you might use Fill method with properly set commands
and the dataadapter will refresh the datatable for you.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

" Jason Shohet" <as****@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP12.phx.gbl...
We have an app that queries 5 tables into a dataset. Now, lets say 1 of
those tables is about to change due to user input on a webpage. Right now, we are manually updating the db with an update command (execute non-query)
in a web service. But now, we're not sure how to now update the table in
the ds. My thinking is requery that 1 table, grab my dataset from the
session & do sda.Fill(myDS, "tblEmployee") which will keep my existing ds, just replacing tblEmployee.

But perhaps there's a better way to do this. It would be nice if I could
just update the dataset value from the datagrid (although that seems like a pain to do) and just do myDS.Save( ) and it automatically know which
table(s) to update in the db so the dataset & the database are in synch.

The other request I would have is, can the above be done in a web service?
(A couple years ago I played around with dropping a dataset on a page and
strong-typing it but I didn't like that it was done on a page, and not a ws. And if the db table structure changed the entire construct broke, which was a pain in the neck)

Thanks for any best-of-breed advice :)


Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.