Hour 7. Modifying Database Data

for RuBoard

Hour 7. Modifying Database Data

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


Sams Teach Yourself ADO. NET in 24 Hours
Sams Teach Yourself ADO.NET in 24 Hours
ISBN: 0672323834
EAN: 2147483647
Year: 2002
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net