E
Eidolon
I have a class which inherits from System.Data.DataTable. The code is
basically (property procs omitted for clarity):
Public Class DataTable()
Inherits System.Data.DataTable
Public Property SQL As String = ""
End Class
Now, i have a proc which given a SQL returns the System.Data.DataTable
from execution. I am trying to use this as follows (code simplified for
clarity):
Dim dt As MYLIB.DataTable, sSQL As String = "SELECT * FROM MYTABLE"
dt = MyProc(sSQL)
dt.SQL = sSQL
When run, it tells me "Specified cast is invalid." Why? my
MYLIB.DataTable class inherits from System.Data.DataTable. This is a
widening conversion, so what is the problem?
Thanks in advance,
- Aaron.
basically (property procs omitted for clarity):
Public Class DataTable()
Inherits System.Data.DataTable
Public Property SQL As String = ""
End Class
Now, i have a proc which given a SQL returns the System.Data.DataTable
from execution. I am trying to use this as follows (code simplified for
clarity):
Dim dt As MYLIB.DataTable, sSQL As String = "SELECT * FROM MYTABLE"
dt = MyProc(sSQL)
dt.SQL = sSQL
When run, it tells me "Specified cast is invalid." Why? my
MYLIB.DataTable class inherits from System.Data.DataTable. This is a
widening conversion, so what is the problem?
Thanks in advance,
- Aaron.