Sql and c#

D

DaveP

hi all.
i have a Situation where i have a offline table using
dataset and (sqlAdapter)
this table has many rows...i need to line a id column
to another ID2 Column Back at the database

i dont want to select 1 by 1 select from the database

looking for examples of getting the data from the server to complete my
record set (table) and do a batch updata

this table data is from a external text file that was parsed into the
offline table

TiA
DaveP
 
A

Arnshea

hi all.
i have a Situation where i have a offline table using
dataset and (sqlAdapter)
this table has many rows...i need to line a id column
to another ID2 Column Back at the database

i dont want to select 1 by 1 select from the database

looking for examples of getting the data from the server to complete my
record set (table) and do a batch updata

this table data is from a external text file that was parsed into the
offline table

TiA
DaveP

What database are you using? If I understand your problem correctly
then about the best you can do is use some kind of ArrayBinding to
bind all of the offline IDs to an update statement. Not all .NET
providers support array binding.

Other alternatives:
-Combine several update statements into a batch and repeatedly
transmit the batch. You can programmatically handle binding values
(e.g., Parameters["NewField"+i].Value = ....) to avoid inlining
parameter values. Experiment to find the largest batch size your
database will support.

-Create a stored procedure that updates values for several rows at
once, call the stored procedure repeatedly until you've updated all
values.

I'm pretty sure the ODP.net drives for Oracle have support for
ArrayBinding. I haven't seen any comparable ability for SqlServer2000
but this may have been added in 2005...
 

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