|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Typed DataSet from existing DataSetI 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 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? > 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 > 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 > 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. -- Show quoteHide quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "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 >> > > 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 >
Other interesting topics
OrderID or DataTable
Currency Manager copying an object by value Multiple relation in dataset. Getchanges problem on expression column using an xml file to store a pre-connection value--- client-server app where data is disconnected, but stays fresh Concurrency Problem: Two separate dynamic SQL queries. SqlCommandBuilder.DeriveParameters not working for CLR Stored Procedure. ADO.NET Abstraction Layer: Basic SQL building blocks? |
|||||||||||||||||||||||