473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

convert untyped datatable/dataset into strongly typed


Hello,
I am trying to create a strongly typed datatable/dataset from an untyped
dataset or datatable returned from a stored proc.

The structure of the table cannot be static since the results are
dynamic which means that I am right now creating the schema/structure of
the datatable from a datareader using reader.GetSchemaTable() and then
looping thru the reader to populate values.

Is there any other efficient way of achieving this? GetSchemaTable() is
another round-trip to the DB that I am trying to avoid.

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 6784
Hi Somebody,

Since your stored proc returns you various schemas there is no way you could
do it fully automatically.
You'll have to create a strong typed dataset per result at design time.
BTW, you don't need GetSchemaTable to retrieve data.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Somebody_Out_There" <so**************@devdev.com> wrote in message
news:e4**************@TK2MSFTNGP09.phx.gbl...

Hello,
I am trying to create a strongly typed datatable/dataset from an untyped
dataset or datatable returned from a stored proc.

The structure of the table cannot be static since the results are
dynamic which means that I am right now creating the schema/structure of
the datatable from a datareader using reader.GetSchemaTable() and then
looping thru the reader to populate values.

Is there any other efficient way of achieving this? GetSchemaTable() is
another round-trip to the DB that I am trying to avoid.

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
1
by: Nedu N | last post by:
Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data into typed dataset in order to ease the further...
3
by: Rakesh Rajan | last post by:
Hi, I have a method, which opens a connection, creates an untyped datable, fills it and returns it back. I have defined a typed datatable in my application as well. For some reasons, I have to...
0
by: jdipalmajr | last post by:
I noticed that I was getting performance issues when I referenced a strongly typed dataset using untyped references. When I changed my code to only use strongly typed references the performance...
7
by: Przemo | last post by:
Hi, I wonder about performerce comparision between these two types of DataSets. Are benefits of typed DataSets enought to beat speed of untyped ones? Or it doesn't matter? What do you think? ...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
0
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Based on what I have read, I think I need to do the followings: 1. DataSet.WriteXmlSchema 2. Xsd.exe I assume this will work but I wonder how to generate strongly typed dataset from untyped...
1
by: zlf | last post by:
Hello As a known issue, WCF does not allow to transfer typed DataSet. So I have to copy all data from typed DataSet to untyped DataSet(same table names, column names and row data). What is the...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.