Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Data Table name in dataset
Message
From
11/03/2012 14:35:51
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01537984
Message ID:
01537986
Views:
35
>Say I am creating a data set as following:
>
>
>DataSet MyDataSet = new DataSet();
>Adapter.Fill( MyDataSet );
>
>
>I don't know what is the default name of the table inside the data set. But I want to set the name of this table to be specific to what I need (e.g. "MyTable"). How can I do it?
>
>Note that since the variable Adapter is of type IDbDataAdapter, I cannot pass the second parameter to the .Fill() method.

Here it is:
                ' Adjust to our default name
                oDataSet.Tables("Table").TableName = "Temp"
Then, you can refer as Temp or whatever the name you wish to have:
                ' Record count
                nCount = oDataSet.Tables("Temp").Rows.Count
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform