Sorry for the very basic C#/SQL question.
I have a stored proc that returns several tables of data. In my code I have a dataset that is populated by this stored procedure. I can access the various tables of information in the general manner: myDataSetTables.Tables[ 2 ] or myDataSetTables.Tables[ "myTableName" ]
My question is that when the dataSet is filled from the stored procedure the table names of all the tables that are generated in the dataSet are always Table1, Table2, Table3, etc...
What I would like to be able to do is define the table name through the stored procedure, but I don't know if this is even possible.
Again, I'm sorry this is such a basic question, and there might not be a solution. I thought a stored procedure like this would work: SELECT * FROM [MyTable] AS [TableNameIDefine]. An then you could access it in the code by: myDataSet.Tables[ "TableNameIDefine" ]
Any help would be greatly appreciated, thanks!

How to name DataSet Tables through a Stored Procedure?
thames
I understand what you mean. If you are filling a dataset using a dataAdapter, I guess you could put in the name of the table yourself but I am guessing you do not wish to do this but rather be done automatically.
sirmmo
Well I ended up just adding another column to my select statements and aliasing them to 'TableName'. Then I cycle through the dataset and assign that way. Seems like a work around, but got the job done. I'd still like to know a better solution.
ex:
SELECT [FirstName],[LastName],'EmployeeName' AS [TableName] FROM [EmployeeName]