473,659 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating Database Prob

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
2 1300


"Commander Ace" <Co**********@d iscussions.micr osoft.com> wrote in message
news:8E******** *************** ***********@mic rosoft.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(yourdat aset)

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
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**********@d iscussions.micr osoft.com> wrote in message
news:8E******** *************** ***********@mic rosoft.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(yourdat aset)

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
16158
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
11
1635
by: chrisc | last post by:
Hello, My infamous manufacturing database continues to bane my life, mostly because I'm really stumbling around in the dark here! What I am trying to do is populate some fields automatically dependent on choices made elsewhere, I'll set the scene: Users take a PCB off of the production line and put it through our testing mechanisms. At present it is logged on a peice of paper and
11
1801
by: Diarmuid | last post by:
I don't understand how I update the table underlying the dataseet Heres what I have at the moment. In this simple example, it works fine until I try adapSimple.Update(dsSimple, "Customers") What should I be doing instead? Thanks Diarmuid Dim stSQL As String = "SELECT * FROM Customers"
2
1108
by: Muhammad Qasim via DotNetMonster.com | last post by:
first sory for posting pure database question but i hav a prob n i m helpless so i m posting it my prob is my sqlserver on server machine is running ver very slow like it takes 5min to just expand that database link and same with all other,, and server performance is ok only Entrp mngr is creating problems and on other if i register it on nay other machine it works fine if any one can give me the use full solution then please reply waiting...
2
2844
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to 200-300 Mb). After compacting the file shrinks back to 3-4 Mb. I have performed the following experiment. I created a test database containing only one table with two columns (Key number, Value text(50)). The table contains 10 thousands...
4
2370
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary key in A) and other field holding a string.
5
1395
by: shrimala | last post by:
Everyday when data is fed in Access, it is fine in the database; but when checked in the morning, sometimes it is corrupt. What may be the prob and how to rectify it?
15
7357
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the original record (which I am doing fine - getting the correct key) and I need to update the "notes" with the new value from the form, which I store in a String Variable. (I've tried storing in a Variant variable; didn't work for me)
18
1965
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and decrement it to the current quantity for example if tehre is a part woth part no 10023 and its quantity in show room is 20 and total quantity is 25 then if there is a sale of 2 parts then i have to add the sale and decrement the current quantity in the...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.