tags:

views:

37

answers:

1

hi,

my situation is the following: i have a datareader and loop over all records returned by a select statement and then call a function with a value from that row. but now i need to update a column in each row, after the function has been called.

using a separate update statement seems like a huge overkill. what's the best method to do so? i've heard about dataadapters and datasets—but the only thing i know is that they exist, not how to use them (properly) in this case.

platform is c# with sql server

A: 

Here is a link to MSDN's explanation of DataAdapters:

http://msdn.microsoft.com/en-us/library/tkctt675.aspx

DataSets:

http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx

4 guys from rolla article on using data adapters:

http://www.4guysfromrolla.com/webtech/chapters/ASPNET/ch06.7.shtml

When to use DataSet and DataAdapters:

http://geekswithblogs.net/ranganh/archive/2005/04/25/37618.aspx

Kevin
and which one is the recommended way? to me it's not really clear from reading msdn
knittl
It depends on your scenario. I've provided another link to tell when to use each.
Kevin