The DataAdapter.Fill method does not set all of the properties of the DataTable and DataColumn objects (310373)
The information in this article applies to:
- Microsoft ADO.Net 2.0
- Microsoft ADO.NET (included with the .NET Framework)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic 2005
This article was previously published under Q310373
This article refers to the following Microsoft .NET Framework Class Library namespace:
SYMPTOMS
After you use the DataAdapter.Fill method, various properties of the DataTable and DataColumn objects (such as primary keys, auto increment fields, nullable fields, unique indexes, and so on) are not set.
CAUSE
The DataAdapter object is optimized for read-only scenarios by default. The Fill method only retrieves the amount of schema that is necessary to display the data. You must take extra steps to obtain the additional schema that are necessary to update or validate an object.
RESOLUTION
To obtain additional information about the DataSet object, use one of the following methods:
- Call the DataAdapter.FillSchema method to obtain extended schema information.
- Set DataAdapter.MissingSchemaAction to MissingSchemaAction.AddWithKey before you call the Fill method.
For additional information about when to use the FillSchema method and MissingSchemaAction property, click the article number below to view the article in the Microsoft Knowledge Base:
310128 When to use FillSchema and MissingSchemaAction
REFERENCES
For more information on ADO.NET objects and syntax, see the following Microsoft .NET Framework Software Development Kit (SDK) documentation or MSDN Online:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbtshoot kbprb kbSqlClient kbSystemData KB310373 kbAudDeveloper |
---|
|