How to return table name from stored procedure in dataset.

Posted by Shantanu Gupta on Stack Overflow See other posts from Stack Overflow or by Shantanu Gupta
Published on 2010-05-10T10:09:14Z Indexed on 2010/05/10 10:14 UTC
Read the original article Hit count: 247

Filed under:
|
|
|
|

I used a dataset to store 15 tables that I need at the time of loading. When i filled all the tables using stored procedure it returns me all the table but name of the table doesn't comes as that of actual table name in a database.

It takes all the table with table name as Table1, Table2, Table3...

I want them to be with the name as they actually are in table.

SELECT PK_GUEST_TYPE, [DESCRIPTION] FROM L_GUEST_TYPE
SELECT PK_AGE_GROUP_ID, AGE_GROUP FROM L_AGE_GROUP
SELECT PK_COMPANY_ID, COMPANY_NAME FROM M_COMPANY
SELECT PK_COUNTRY_ID, COUNTRY FROM L_COUNTRY
SELECT PK_EYE_COLOR_ID, [DESCRIPTION] FROM L_EYE_COLOR
SELECT PK_GENDER_ID, [DESCRIPTION] FROM L_GENDER
SELECT PK_HAIR_COLOR_ID, [DESCRIPTION] FROM L_HAIR_COLOR
SELECT PK_STATE_PROVONCE_ID, [DESCRIPTION] FROM L_STATE_PROVINCE
SELECT PK_STATUS_ID, [DESCRIPTION] FROM L_STATUS

SELECT PK_TITLE_ID, [DESCRIPTION] FROM L_TITLE
SELECT PK_TOWER_ID, [DESCRIPTION] FROM M_TOWER
SELECT PK_CITY_ID, [DESCRIPTION] FROM L_CITY
SELECT PK_REGISTER_TYPE_ID, [DESCRIPTION] FROM L_REGISTER_TYPE

Here is my frontend coding to fill dataset.

             OpenConnection();
             adp.Fill(ds);
             CloseConnection(true);

© Stack Overflow or respective owner

Related posts about c#

Related posts about ADO.NET