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

Questions That Should Be Asked More Frequently

Q

Do I need to use a DataSet if I want to work with only a few rows of data?

A

In this situation, you can use just a DataTable object without using a DataSet. In ADO.NET 2.0, the DataTable class now lets you read and write data to and from files and streams and offers support for XML features. If you need to work with data from various DataTables, you might consider using a DataSet.

Q

I added a row to my DataTable, and when I submitted the new row to my database, I received an error that said the new row violated the primary key constraint on the table. Why didn’t I receive this error when I added the row to the DataTable?

A

ADO.NET enforces the constraints you create based on the data in your DataSet. The ...

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