O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Strongly Typed DataSet Objects

Strongly typed DataSet objects simplify the development process, making it easier to write code to access and modify the contents of your DataSet. Let’s look at a few examples that compare working with data in a standard untyped DataSet versus working with a strongly typed DataSet.

Adding a Row

Each class for the DataTable objects in your DataSet offers two ways to add a new row to the DataTable. Calling New<TableName>Row returns a new strongly typed DataRow for your DataTable. You can then set values for columns in the row using properties of the strongly typed DataRow, as shown in the following code snippet:

Visual Basic

Dim ds As New NorthwindDataSet() Dim tblCustomers As NorthwindDataSet.CustomersDataTable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required