|
-
August 11th, 2003, 09:17 PM
#1
how to update the datasource?
hi im new in vb.net and i cant save the changes i made in the tables.
Is there anyone who can help me how to save the changes i made? I read some article about this already and it says use the update method of the adapter. But when i did that it updates only the dataset and when i looked the the table from my SQL server the data is not change.
Can anyone help me? thanks in advance
Thanks!!!
Kristine
-
August 12th, 2003, 02:21 AM
#2
INSERT, DELETE, UPDATE
A dataadapter works this way " I think"
when you update the dataadapter........
first thing it will do is to check the rowstate of each and every row on your "dataadapter(dataset,"tablename")
if you made an insert, delete or update on the dataset the rowstate of the affected row changes. let say for insert..... rowstate would be Added, for delete row state would be deleted and for update rowstate would be modified........
now lets go back to the dataadapter........ Once the dataadapter sees these changes...... The dataadapter fires its UpdateCommand for updates, InsertCommand for Inserts and DeleteCommand for deletion.....
all you need to do is assign sql statement for these command..... to make you life easier ..... you can use CommandBuilder instead ..... this will generate the sql statements for you under the hood.....
VISIT THIS LINK:
http://msdn.microsoft.com/library/de...et05282002.asp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|