none
Inserting rows using ADO.NET dataadapter for SQL server 2005 RRS feed

  • Question

  • Hi,

    I am trying to insert rows in SQL server 2005 as follows :

    SqlDataAdapter adapter = new SQLDataAdapter("Select * from LogIt", conn);
                    SqlCommandBuilder cb = new SqlCommandBuilder(adapter);
                    adapter.InsertCommand = cb.GetInsertCommand();
                    adapter.Update(table);

    Now, it is inserting rows in SQl server with all values as null. I checked my source datatable and it had data in every column.

    Any guess ?

    Thanks
    Kulvinder Singh
    Monday, September 22, 2008 8:08 AM

Answers

All replies