473,396 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Saving Data when modified

daniel aristidou
491 256MB
Hi guys im stuck in vb08 again......

Im trying to save the database after editing with a datagrid.
It saves ok when a new record has been added but not when existing data has been modified.

This is the code im using
Expand|Select|Wrap|Line Numbers
  1. Try
  2.  Me.Validate()
  3.  Me.Customerbindingsource.endedit()
  4.  Me.customertableadapter.update(me.fortedataset1.Customers)
  5.  msg("Data saved")
  6. Catch ex as exception
  7.  Msg("saved Failed")
  8.  e.cancel = True
  9. End try
The error occurs on the Me.Customertableadapter.update(me.fortedataset1.Cu stomers) line
The default error message is:
"Update requires a valid updatecommand when passed datarow with modified rows"

Any solution?

Daniel(~_~)
Jan 5 '08 #1
8 1332
QVeen72
1,445 Expert 1GB
Hi,

Check the Update Command for the Customeradapter.
usually, "Update" Statements are not built automatically, you have to Create a New for Update with proper SQL Syntax..

REgards
Veena
Jan 5 '08 #2
daniel aristidou
491 256MB
Hi,

Check the Update Command for the Customeradapter.
usually, "Update" Statements are not built automatically, you have to Create a New for Update with proper SQL Syntax..

REgards
Veena
Then what does the
Me.Customerstableadapter.Update(etc)
Do?
Jan 5 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

Post here , What is your Update SQL Statement...?
May be, Update Statement is there but there is no proper "Where Conditions"..
Its better if Where Condition is based on the PK of the table..

REgards
Veena
Jan 5 '08 #4
daniel aristidou
491 256MB
Hi,

Post here , What is your Update SQL Statement...?
May be, Update Statement is there but there is no proper "Where Conditions"..
Its better if Where Condition is based on the PK of the table..

REgards
Veena
I cannot find a statement anywhere except for the fill data statement which is used to copy the records from the dataset to the adapter.
Jan 5 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

Right-Click the adatpter object >> Edit Queries in dataSet Designer
Select Adapter RightClick >> Add Queries >> Next >> Select OptionUpdate
>> Next
Check What is the Updte Statement..

Regards
Veena
Jan 5 '08 #6
daniel aristidou
491 256MB
Hi,

Right-Click the adatpter object >> Edit Queries in dataSet Designer
Select Adapter RightClick >> Add Queries >> Next >> Select OptionUpdate
>> Next
Check What is the Updte Statement..

Regards
Veena
The Update statement is simply "update"
Jan 5 '08 #7
daniel aristidou
491 256MB
The Update statement is simply "update"
But how do i enforce the statement
Jan 5 '08 #8
daniel aristidou
491 256MB
But how do i enforce the statement
I moved on to this
Dim adpt as tableadapter
adpt.updatecommand() But im stuck on that......it wont let me use it. and seems to return "Nothing"

Also as per The Sql Statment. I dont know sql at all. can some one help me create an update statement It says whenever i try ........."token line 1, tokenline to 25"
Jan 5 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: ken | last post by:
I have a XML file as below ---------------------------------------------------------------------------------------------------------------------- <?xml version="1.0" standalone="yes"?> ...
1
by: akermisch | last post by:
I have an SDI application with two splitter panes. The application is designed to open a text file and the user then can utilize a set of tools to modify the text. The modified text appears in a...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
4
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a...
1
by: WhiskyRomeo | last post by:
Since I can't get answer from the author, can someone address this? In this article . . . http://msdn.microsoft.com/msdnmag/issues/04/05/DataPoints/default.aspx In the "The Transaction and...
1
by: Tom | last post by:
I have a large application; lots of forms, multiple dynamic DLLs, etc. I also have, in the appliation, a general 'Preferences' class object (which is in itself a separate DLL, and I just include a...
8
by: Mark | last post by:
Hello. I am attempting to write binary data from a file to an OLE Object field, and then write the file back out from the database. I am reading and writing the files in binary mode, and using...
11
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a...
0
by: Magnus Bergh | last post by:
I am developing an application for pocketpc and this involvs a but of juggling with different forms. I have an "order entry" type of application. On the main form I have a grid which displays...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.