Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

At work we have a data access layer that has been developed by one of developers. Things is it works well enough with the exception of one thing.

 

There is a class in this datalayer that subclasses System.Data.Datatable. So for example if I populated a System.Data.Dataset and then tried to put the first table of this dataset into this class like so:

Dim dt as new myDatable
dt = ds.Tables(0)

I get an InvalidCastException. I have created the most basic of classes for myDatable.

Public Class myDatable: Inherits System.Data.DataTable
   
End Class

 

Is there as interface missing or something?

Posted

Ds.Tables(0) is a datatable. What your saying is what I expected.

 

Thanks for confirming this, I just wanted to know if the table in the dataset could be cast to a subclass of datatable.

 

Just so long as I know.

 

Cheers, Dave.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...