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

Updating Database Prob

P: n/a
Hi, I'm having some problems with updating an SQL Database with modified
fields from a datatable. I got the code from a Wrox book, 'Professional
VB.NET 2003', the same code can be found here:
http://media.wiley.com/product_ancil...2_23_24_25.zip \Chapter 16\AuthorEditor
Basically when I have made a change and save it, close and reopen the
program the changes that I made have gone, and it’s the original data again.
Could someone please help as I am at the end of my tether with this one!!

Cheers
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


"Commander Ace" <Co**********@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
Hi, I'm having some problems with updating an SQL Database with modified
fields from a datatable. I got the code from a Wrox book, 'Professional
VB.NET 2003', the same code can be found here:
http://media.wiley.com/product_ancil...2_23_24_25.zip
\Chapter 16\AuthorEditor
Basically when I have made a change and save it, close and reopen the
program the changes that I made have gone, and it's the original data
again.
Could someone please help as I am at the end of my tether with this one!!

Cheers


I opened your zip file and there's a shed load of stuff in there.
Far more than I'm willing to sift through.
Posting just the little bit of code you thought did the update might have
meant I could give specific help.

Assuming you have the grid, a dataadaptor and a dataset.
You apply changes using one line of code.
This is something of the form:
yourdataadaptor.Update(yourdataset)

Up until you do that, any changes are just going into a locally cached
version of the data.
That's why them datasets are referred to as being disconnected.
You read em in by filling the dataset, the user fiddles with em, you write
em back using the update method.

If you got something like that line in your code then check to see you have
some sort of sql statement the dataadaptor can apply on updating.
When you generate a dataset you can check boxes to generate the select,
update delete and whatnot. If you didn't choose the update then I'm not
sure what happens, but it ain't going to get updated.

--
Regards,
Andy O'Neill
Nov 21 '05 #2

P: n/a
Cheers Andy, the project you want to look at is in the \Chapter
16\AuthorEditor folder of that zip file. I'm going to have a go at what you
said shortly. Thanks again

"Andy O'Neill" wrote:


"Commander Ace" <Co**********@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
Hi, I'm having some problems with updating an SQL Database with modified
fields from a datatable. I got the code from a Wrox book, 'Professional
VB.NET 2003', the same code can be found here:
http://media.wiley.com/product_ancil...2_23_24_25.zip
\Chapter 16\AuthorEditor
Basically when I have made a change and save it, close and reopen the
program the changes that I made have gone, and it's the original data
again.
Could someone please help as I am at the end of my tether with this one!!

Cheers


I opened your zip file and there's a shed load of stuff in there.
Far more than I'm willing to sift through.
Posting just the little bit of code you thought did the update might have
meant I could give specific help.

Assuming you have the grid, a dataadaptor and a dataset.
You apply changes using one line of code.
This is something of the form:
yourdataadaptor.Update(yourdataset)

Up until you do that, any changes are just going into a locally cached
version of the data.
That's why them datasets are referred to as being disconnected.
You read em in by filling the dataset, the user fiddles with em, you write
em back using the update method.

If you got something like that line in your code then check to see you have
some sort of sql statement the dataadaptor can apply on updating.
When you generate a dataset you can check boxes to generate the select,
update delete and whatnot. If you didn't choose the update then I'm not
sure what happens, but it ain't going to get updated.

--
Regards,
Andy O'Neill

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.