Thanks for your answer,
In my case y can fill the strongly typed DataTable as you've suggested, but
the thing is that right now i am learning this kind of "stuff" (i mean
ADO.NET) while building my application, so i allready have set a proyect for
manipulating data, and i have set al methods in the classes of this proyect
to return DataSet and DataTable objects to use in the buisennes ruels
proyect, so I do want to follow your sugestion of filling directly the
strongly typed DataTable, but how do i arrange the hole design of the tiers.
"Ryan Trudelle-Schwarz" <(E-Mail Removed)> escribió en el mensaje
news:(E-Mail Removed)...
>> Hi,
>> The following code throws me an Error, i use a method to bring a
>> DataTable
>> object and i want to asigne it to a Strongly Typed DataTable, but VB
>> doesn't
>> allow me.
>> How can i do this right? And if it couldn't be done, then wich would
>> be an
>> equivalent solution.
>> Thank you very much.
>> 'FoldersDataTable: Inherits from DataTable.
>> Dim Data As New FoldersDataTable
>> 'BringDataTable: Retrives a DataTable object
>> Data = CType(BringDataTable("Select * From Folders"),
>> FoldersDataTable)
>> 'Error: 'InvalidCastExeption'
>
> Right, you are trying to do an upcast essentially, which is never
> permissable.
>
> You have a few options (OTTOMH):
> 1) Fill the super data table directly.
> 2) Copy the data from one to the other.
>
> Obviously 1 will be more performant than 2 but depending on your
> circumstances may not be possible.
>
> hth, Ryan
>
|