The Data Access Application blocks gives a set of
methods which can be used to return a
dataset,datareader etc . This dataset has to be copied
into a specific datatable which we have built in a
custom class which in turn derives from a dataset
class.
>From our research we have found that this is not
possible. DataTables in a dataset are readonly and
can't be assigned to. We can add rows to a datatable
but we can't assign a datatable from one dataset to a
datatable in another dataset directly.



--- Shawn Wildermuth <[EMAIL PROTECTED]> wrote:
> Unfortunately I have not looked at the Data Access
> Application Blocks.
> What I would do is get the object returned as an
> object
> (typeof(object)), and look at it runtime to see what
> its identity is.
> This might help you understand better why the
> casting isn't working.
>
> Thanks,
>
> Shawn Wildermuth
> [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: dotnet discussion
> [mailto:[EMAIL PROTECTED]]
> > On Behalf Of george antony
> > Sent: Sunday, April 21, 2002 5:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [DOTNET] problem in data set type
> casting.
> >
> >
> >  We get an invalid type cast error . What we want
> to
> > achieve is to fill a specific datatable of one
> dataset
> > from another dataset which is returned from a
> method.
> > sorry for the previous mail.
> >
> > thanks
> > George
> > --- Shawn Wildermuth <[EMAIL PROTECTED]>
> wrote:
> > > What is the error you are getting?
> > >
> > > Thanks,
> > >
> > > Shawn Wildermuth
> > > [EMAIL PROTECTED]
> > >
> > > > -----Original Message-----
> > > > From: dotnet discussion
> > > [mailto:[EMAIL PROTECTED]]
> > > > On Behalf Of george antony
> > > > Sent: Sunday, April 21, 2002 1:22 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [DOTNET] problem in data set type
> > > casting.
> > > >
> > > >
> > > > We are using the Data
> > > > Access Application blocks of .Net for getting
> data
> > > > from Database.  This has a method for
> retrieving a
> > > > dataset . We have a custom class which
> inherits
> > > from a
> > > > DataSet and builds its own DataTables .We are
> > > trying
> > > > to use the  ExecuteDataSet method of the data
> > > Access
> > > > Application block and use that to populate the
> > > DataTable in
> > > > our custom class . We are not able to do this
> .Can
> > > someone
> > > > tell us if this is possible by some other way?
> > > >
> > > > The code is like this
> > > > // custom class inheriting from DataSet
> > > > public class AssetData :DataSet
> > > > {
> > > > // add DataTables here
> > > > }
> > > >
> > > >
> > > > AssetData ad =
> > > >
> > >
> >
>
SqlHelper.ExecuteDataSet(conn,commandtype,commandText,SqlParams)
> > > >
> > > > This line gives an error. I am not able to
> make it
> > > > work even if I cast the resulting dataset to
> the
> > > type
> > > > AssetData
> > > >
> > > > thanks for any help
> > > > George
> > > >
> > > >
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Yahoo! Games - play chess, backgammon, pool
> and
> > > more
> > > http://games.yahoo.com/
> > >
> > > You can read messages from the DOTNET archive,
> > > unsubscribe from DOTNET,
> > > or subscribe to other DevelopMentor lists at
> > > http://discuss.develop.com.
> > >
> > > You can read messages from the DOTNET archive,
> > > unsubscribe from DOTNET, or
> > > subscribe to other DevelopMentor lists at
> > http://discuss.develop.com.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Games - play chess, backgammon, pool and
> more
> http://games.yahoo.com/
>
> You can read messages from the DOTNET archive,
> unsubscribe from DOTNET,
> or subscribe to other DevelopMentor lists at
> http://discuss.develop.com.
>
> You can read messages from the DOTNET archive,
> unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at
http://discuss.develop.com.


__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to