Data adapters

D

Dathan

I'm using some table adapters that were auto-generated by the Visual
Studio data set designer. I'm trying to use partial classes to make
them expose a common set of functionality so I can track them using
generics (I don't believe I can use a common base class because I want
to expose a Fill(DataTable) method, the implementation of which will
vary by class). So I create a partial class for each one, have it
derive from my interface (interface ISomeInterface{int Fill
(System.Data.DataTable); int Update(System.Data.DataTable)), and
implement the two methods just fine. Everything compiles. However,
when I try to use ISomeInterface to refer to my table adapters, I get
"cannot convert from someTableTableAdapter to ISomeInterface". Where
am I going wrong?
 
I

Ignacio Machin ( .NET/ C# MVP )

I'm using some table adapters that were auto-generated by the Visual
Studio data set designer.  I'm trying to use partial classes to make
them expose a common set of functionality so I can track them using
generics (I don't believe I can use a common base class because I want
to expose a Fill(DataTable) method, the implementation of which will
vary by class).  So I create a partial class for each one, have it
derive from my interface (interface ISomeInterface{int Fill
(System.Data.DataTable); int Update(System.Data.DataTable)), and
implement the two methods just fine.  Everything compiles.  However,
when I try to use ISomeInterface to refer to my table adapters, I get
"cannot convert from someTableTableAdapter to ISomeInterface".  Where
am I going wrong?

can you post some of your code?
with the class header is fine I guess

Also , have you try Linq to SQL?
 
D

Dathan

can you post some of your code?
with the class header is fine I guess

Also , have you try Linq to SQL?

I figured it out. Stupid mistake on my part. I just didn't put my
partial class implementation in the right namespace. Doh! Thanks for
the response, though.
 

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