Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filling tables in a dataset
Message
 
To
17/05/2006 20:42:52
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01123034
Message ID:
01123338
Views:
16
The jury has decided to give you the 3 solution stars :)
I must admidt that I like option 1 below better than option 2 :)
Anywho thanks for the help.

>Einar,
>
>You have a couple different options for filling a Typed DataSet.
>
>A Stored Proc will always return your tables with the names: table, Table1, Table2, etc. Typically you are not going to want to reference the tables that way in your DataSet. There are two ways around this problem.
>
>1) You can define your DataSets with whatever tablenames you need, and then when you fill the DataSet, you can use the DataAdapter.TableMappings.Add( ) method to map table to CustomerInfo, Table1 to CustomerAddress, etc. prior to filling the DataSet from the DataAdapter (Kevin likes to use this methodology).
>
>2) The second option is to define your DataSets with the names table, Table1, Table2, etc. just like the Stored Procs will use when the DataSets are filled. Then, further sub-class the generated Typed DataSet and have a property for each table that in effect renames your table (I prefer this way instead).
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform