I want to read a .csv file into a dataset using an OleDbDataAdapter, then
update a SQL table from these rows. Is there any easier or more efficient
way to do this instead of spinning through the dataset rows and firing off
an INSERT for each of these rows? It seems to me that after I'd filled the
dataset using the OleDbDataAdapter, I could create an SqlDataAdapter for use
with this same dataset for updating. Seems as if I'd also need to map the
fields in the dataset to the Sql table. This all seems possible but I'm not
getting there with the code. Any help is appreciated.
sloan - 25 Mar 2008 22:25 GMT
Ship the dataset.GetXml() off to Sql Server...and allow it to process it.
http://support.microsoft.com/kb/315968
Note, Sql Server 2005 has a different method than OPENXML you might
investigate.
>I want to read a .csv file into a dataset using an OleDbDataAdapter, then
>update a SQL table from these rows. Is there any easier or more efficient
[quoted text clipped - 4 lines]
>the fields in the dataset to the Sql table. This all seems possible but
>I'm not getting there with the code. Any help is appreciated.
bruce barker - 25 Mar 2008 22:49 GMT
yes, thats what dataadapters where designed for and are seperate from
datasets.
-- bruce (sqlwork.com)
> I want to read a .csv file into a dataset using an OleDbDataAdapter, then
> update a SQL table from these rows. Is there any easier or more efficient
[quoted text clipped - 4 lines]
> fields in the dataset to the Sql table. This all seems possible but I'm not
> getting there with the code. Any help is appreciated.