Home All Groups Group Topic Archive Search About

Typed DataSet from existing DataSet

Author
10 Apr 2007 3:38 PM
Robert
I am working in C# creating a Windows Forms application.  I have a dataset
from an Oracle database that I want to change to a typed dataset.  Can this
be done once a dataset that is not typed has been returned from the database?

--
Robert Hill
Author
10 Apr 2007 4:47 PM
Charles Zhang
I do not think so.

Typed datasets is actually implemented using special classes generated
by Visual Studio.NET.  Typed datasets must be created at design time.



Charles Zhang
http://www.speedydb.com (SpeedyDB ADO.NET Provider is the fastest, most
secure ADO.NET Provider over Wide Area Network)


Robert wrote:
Show quoteHide quote
> I am working in C# creating a Windows Forms application.  I have a dataset
> from an Oracle database that I want to change to a typed dataset.  Can this
> be done once a dataset that is not typed has been returned from the database?
>
Are all your drivers up to date? click for free checkup

Author
10 Apr 2007 5:55 PM
RobinS
I know that some people who use n-tier architecture do this. They create
the typed dataset using a stored procedure, then use that in their UI. They
read the table with the stored procedure, pass it back to the UI, and then
cast it to the strong typed dataset. It only works if the structures match
exactly.

Robin S.
-------------------------------------
Show quoteHide quote
"Robert" <rhill***@hotmail.com> wrote in message
news:D1E5E510-82B8-433B-92BB-CEA92073C131@microsoft.com...
>I am working in C# creating a Windows Forms application.  I have a dataset
> from an Oracle database that I want to change to a typed dataset.  Can
> this
> be done once a dataset that is not typed has been returned from the
> database?
>
> --
> Robert Hill
>
Author
10 Apr 2007 6:05 PM
Earl
Use dsStrong.Merge() and pass in your untyped dataset. As Robin indicated,
your untyped structure must match exactly in order to pull this off. You
might also consider merging individual datatables into the strongly-typed
dataset.

Show quoteHide quote
"Robert" <rhill***@hotmail.com> wrote in message
news:D1E5E510-82B8-433B-92BB-CEA92073C131@microsoft.com...
>I am working in C# creating a Windows Forms application.  I have a dataset
> from an Oracle database that I want to change to a typed dataset.  Can
> this
> be done once a dataset that is not typed has been returned from the
> database?
>
> --
> Robert Hill
>
Author
10 Apr 2007 7:46 PM
Miha Markic
Yep, this is the way. As a last resort you might opt for "manual" copying of
each row
There might be another trick you might try. Try WriteXml method on untyped
one (to save it to a stream), transform xml to match the target dataset
(XSLT perhaps) and then ReadXml on typed one.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quoteHide quote
"Earl" <brikshoe@newsgroups.nospam> wrote in message
news:ui0puq5eHHA.928@TK2MSFTNGP02.phx.gbl...
> Use dsStrong.Merge() and pass in your untyped dataset. As Robin indicated,
> your untyped structure must match exactly in order to pull this off. You
> might also consider merging individual datatables into the strongly-typed
> dataset.
>
> "Robert" <rhill***@hotmail.com> wrote in message
> news:D1E5E510-82B8-433B-92BB-CEA92073C131@microsoft.com...
>>I am working in C# creating a Windows Forms application.  I have a dataset
>> from an Oracle database that I want to change to a typed dataset.  Can
>> this
>> be done once a dataset that is not typed has been returned from the
>> database?
>>
>> --
>> Robert Hill
>>
>
>
Author
11 Apr 2007 1:03 AM
Cor Ligthert [MVP]
Robert,

Your typed dataset in windows form format is a piece of to build code.
(And use that builded).

The code to build you can get by writing your XML to disk by using WriteXML.

Open that in your IDE as new item and save it than again by generating
Dataset.

Cor

Show quoteHide quote
"Robert" <rhill***@hotmail.com> schreef in bericht
news:D1E5E510-82B8-433B-92BB-CEA92073C131@microsoft.com...
>I am working in C# creating a Windows Forms application.  I have a dataset
> from an Oracle database that I want to change to a typed dataset.  Can
> this
> be done once a dataset that is not typed has been returned from the
> database?
>
> --
> Robert Hill
>

Bookmark and Share