Hi everyone,
I currently develop an application in vs.net 2005 with vb.net.
I was trying to use typed dataset and I've got in trouble for
converting untyped dataset
into Typed DataSet. I don't know why I cannot perform this casting
operation properly.
First off, I've got my Typed DataSet named "AuthInfo" declared and I
then created an instance of that class. What I'd like to do next is to
perform querying through the method ExecuteDataSet() of Microsoft Data
Access Library which will return me the untyped dataset. Here is the
point, I would like to convert the return untyped DataSet into my Typed
DataSet "AuthInfo" but I'm still getting this error "Unable to cast
object of type 'System.Data.DataSet' to type 'AuthInfo'. ..." I've put
my code snippet here as shown below.
Dim doAuth as AuthInfo
dst = db.ExecuteDataSet(dbCommand)
doAuth = CType(dst, AuthInfo)
I think I've seen someone do something like this before but I've got no
idea what's wrong with my code.