none
How to save a table to db using ADO and NOT TSQL RRS feed

  • Question

  • I have created a datatable and added some columns to it.

     

    Now I want to save the table to db.

     

    Can this be done using a dataadapter instead of building a tsql statement?

     

    Thanx Alot

    Thursday, June 14, 2007 1:26 PM

All replies

  • Hi,

    If the database contains the table, you can use the SqlDataAdapter in combination with the SqlCommandBuilder class:
    http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.aspx

    The command builder will generate some faily basic SQL, so it works only for trivial cases.

    Regards,
    Charles
    Thursday, June 14, 2007 8:12 PM