TableMappingsCollectionEditor breaks with custom Data Provider

S

Stephen Walch

I have a custom DataAdapter which derives from
System.Data.Common.DbDataAdapter and therefore inherits a property of type
System.Data.Common.DataTableMappingCollection. When I place an instance of
my adapter on a WinForm in VS.NET 2003, configure the SelectCommand (using
my custom data provider again) and try to edit the
DataTableMappingCollection, the
Microsoft.VSDesigner.Data.Design.DataTableMappingCollectionEditor complains
that it is "Unable to retrieve the schema from the database table. Source
column mapping information will not be available" and then fails with a
"Specified Cast is not valid" error.

So what is the DataTableMappingCollectionEditor expecting of my DataAdapter?
If it is trying to get schema information, it must be doing so through the
SelectCommand and it's corresponding Connection, but schema retrieval is not
a documented part of IDbCommand or IDbConnection. What is it the cast that
is failing here?

Thanks,

Steve
 
K

Kevin Yu [MSFT]

Hi Stephen,

When filling a dataset, the DataAdapter requires some DataTableMapping
objects to be added to the DataTableMappingCollection. A DataTableMapping
provides a master mapping between the data returned from a query against a
data source, and a DataTable. The DataTableMapping name can be passed in
place of the DataTable name to the Fill method of the DataAdapter. Please
try to check if you have added this mapping in your own code.

For more information, see Setting Up DataTable and DataColumn Mappings.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconsettingupdatatabledatacolumnmappings.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
S

Stephen Walch

Yes, I know what a TableMapping does. My problem is that I can not run the
TabbleMappings editor when I use my custom DataProvider in VS.NET 2003.
Plesae see my prior post for more details.

Thanks,

Steve
 
S

Stephen Walch

Yes, the commands in the data adapter are configured with valid connections.
They are not SQL Server or OLE DB connections, but they are valid
connections to my data source. What in IDbConnection is the editor using to
find the schema?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top