Skip to content Skip to sidebar Skip to footer

C# Sqldataadapter - Not Inserting Data Into Db

Here's what I got: User selects from a checklistbox of database names one they'd like to archive. Switch case in place to catch the selection. case 'userSelection':

Solution 1:

I think you want ExecuteNonQuery.

var rowsAffected = sqlAdapter.InsertCommand.ExecuteNonQuery();

This executes the statement and then returns the number of rows affected. The Fill method won't run any InsertCommands.

Post a Comment for "C# Sqldataadapter - Not Inserting Data Into Db"