468,780 Members | 2,200 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,780 developers. It's quick & easy.

updating database using datatable

hi guys...

i am a student, i am studying and i am a newbie in VB.net and i am
using SQL Server 2000.

I have this datatable which i insert rows (may take up to 2 or more
rows because i would like to perform batch updating). upon clicking of
update button, i would like to insert them all in a table in my
database.

I know this question has been posted before but could you show me guys
a sample code or a link to a code where i can study how to update a
database by a datatable.

help in anyway is very much appreciated.

Thanks

Joel - newbie

Sep 19 '07 #1
1 7979
Hi Joel,

A DataTable is a disconnected set of data. It may or may not be data from a
database, or have anything to do with a database. When a DataTable is
populated from a database, it must be populated by a DataReader, either as a
member of a DataAdapter, or independently. The DataReader or DataAdapter has
the Connection to the database. So, to insert data into a database, either a
Connection and Command must be used, or a DataAdapter, which contains a
Connection and a set of Commands must be used. In any case, the data is not
literally updated as a batch, but in a looping construct that inserts the
records one at a time. How you wish to do the insertion work is up to you.
For more information, see the following:

http://msdn2.microsoft.com/en-us/lib...x7(VS.71).aspx
http://msdn2.microsoft.com/en-us/lib...wf(VS.71).aspx
http://msdn2.microsoft.com/en-us/lib...8z(VS.71).aspx

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"joel" <co*********@hotmail.comwrote in message
news:11**********************@n39g2000hsh.googlegr oups.com...
hi guys...

i am a student, i am studying and i am a newbie in VB.net and i am
using SQL Server 2000.

I have this datatable which i insert rows (may take up to 2 or more
rows because i would like to perform batch updating). upon clicking of
update button, i would like to insert them all in a table in my
database.

I know this question has been posted before but could you show me guys
a sample code or a link to a code where i can study how to update a
database by a datatable.

help in anyway is very much appreciated.

Thanks

Joel - newbie

Sep 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sandman | last post: by
3 posts views Thread by Jon Agiato | last post: by
13 posts views Thread by Doug Bell | last post: by
3 posts views Thread by RSH | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.