for RuBoard |
As you saw in the preceding hour, the Command object is used in conjunction with the DataAdapter object to retrieve records from your data source and place them into a DataSet , which can then be displayed or manipulated. However, suppose you want to insert data, delete data, or perform any other valid action on the database that doesn't return any records. For this, you can use the ExecuteNonQuery() method of the Command object.
The ExecuteNonQuery() method executes a SQL statement against your data source. In this hour you'll see how to apply the SQL statements from Hour 3, "Using T-SQL: A Crash Course," to
Insert new data into the database
Delete data from the database
Modify data in the database
The examples in this hour again use ASP.NET Web forms to provide concrete, real-life examples showcasing ADO.NET code. However, the ADO.NET code works just as easily with Windows forms.
for RuBoard |