Re: Creating a datatable on a SQL server from a dataset by William
William
Tue Oct 03 00:29:51 CDT 2006
I would try to create a DataReader from the XML and pass it to SqlBulkCopy.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
Between now and Nov. 6th 2006 you can sign up for a substantial discount.
Look for the "Early Bird" discount checkbox on the registration form...
"Yellow Dog" <BigYellowDog@nospam.houston.rr.com> wrote in message
news:obq3i21s6aa6v50bsgp0rocc3905p8esuj@4ax.com...
>
> This is probably covered somewhere, but I am having a total brain
> cramp.
>
> I have a DataSet that gets loaded from an XML file. I want to do some
> processing on it and then save it to a SQL Server data table. I am
> currently doing by the brute force expedient of creating a
> SqlConnection, building a string that contains the SQL statements to
> CREATE the data table and then executing the SQL via an
> ExecuteNonQuery.
>
> It works, but there is a very nagging loud voice in my head telling me
> that I am doing it the hard way.
>
> If anyone know of an easier way or has a link to some sample code that
> does a similar type of process, I would be greatly appreciative.
>
> TIA,
>
> If it ain't broke....fix it anyway!
>
> [To Email Replies Remove the nospam from the address]