How does C#.Net update data?

J

Jason Huang

Hi,

In my C#.Net Windows Form, I can insert 10 rows into MyDataBase.MyTable,
using SqlDataAdapter and SqlParameter with no porblem.
But this raise my question, HOW does this 10 rows insert into the MyTable.
Is this 10 rows inserted into the MyTable one by one, or that 10 rows is
stored in some place,
and the insert into MyTable at once?
Any advice will be appreciated.

Jason
 
R

Richard Blewett [DevelopMentor]

Jason Huang said:
Hi,

In my C#.Net Windows Form, I can insert 10 rows into MyDataBase.MyTable,
using SqlDataAdapter and SqlParameter with no porblem.
But this raise my question, HOW does this 10 rows insert into the MyTable.
Is this 10 rows inserted into the MyTable one by one, or that 10 rows is
stored in some place,
and the insert into MyTable at once?
Any advice will be appreciated.

Jason

I assume you mean inserting via the SqlDataAdapter.Update command. If you
are using 1.1 each inserted row will incur a roundtrip to the database. If
you are using 2.0 you can set the UpdateBatchSize property so send the
DataTable changes to the database in batches.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top