BUG: The FillSchema method may not include schema for the PrimaryKey column for the join query (817183)
The information in this article applies to:
- Microsoft ADO.Net 2.0
- Microsoft ADO.NET (included with the .NET Framework 1.1)
- Microsoft ADO.NET (included with the .NET Framework) 1.0
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSWhen you create a SqlDataAdapter object for a join query that has columns only from one table that
is used in the query, the FillSchema method of the SqlDataAdapter object does not include the schema for the PrimaryKey column of
the table. This problem does not occur when the join query has columns from
both tables.WORKAROUNDTo work around this problem, add the PrimaryKey column to
the table manually. To do this, add the following statement to the code after
calling the FillSchema method. Visual Basic .NET code' If first column of table is primarykey
MyTable.PrimaryKey = New DataColumn() {MyTable.Columns(0)} Visual C# .NET code// If first column of table is primarykey
MyTable.PrimaryKey =new DataColumn[]{MyTable.Columns[0]}; -or- You can use a OledbDataAdapter object instead of a SqlDataAdaptor to connect to Microsoft SQL Server. STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.REFERENCESFor more information about the DataAdapter.FillSchema method, see the following Microsoft Developer Network (MSDN) Web
site:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbtshoot kbvs2002sp1sweep kbProvider kbQuery kbSchema kbtable kbSystemData kbSqlClient kbDatabase kbDataAdapter kbbug KB817183 kbAudDeveloper |
---|
|