views:

25

answers:

1

Hi all,

I want to select certain amount of data from one table. Based on those data, I want to check another two tables and insert into 2 tables.

So I want to iterate the resulted data. Which way is better(faster) and reasonable using DataReader or DataTable?

Thanks in advance RedsDevils

+1  A: 

You end up creating a reader to fill the table. The reverse isn't true, So I would stick with the dataReader.

-Josh

JoshRoss
Thanks Josh. How about my MS SQL Database is 2000? Is there any way to avoid DataTable?
RedsDevils
If possible, create a stored procedure on the server. That way you don't have to bring back anything.
JoshRoss
Here is the BOL link to creating a proc... http://msdn.microsoft.com/en-us/library/ms187926.aspx
JoshRoss