Here's my Stored Procedure:
CREATE PROCEDURE GetProdsAndCats AS
Select * from Products
Select * from Categories
go
Here's my Console app:
SqlConnection conn = new Connection(...);
SqlDataAdapter da = new SqlDataAdapter("GetProdsAndCats",conn);
da.SelectCommand = new SqlCommand("GetProdsAndCats",conn);
da.SelectCommand.CommanndType = Command.StoredProcedure;
DataSet ds = new DataSet();
da.Fill(ds);
Console.WriteLine(ds.Tables[0].TableName);
Console.WriteLine(ds.Tables[1].TableName);
The problem with this is that I get "Table" and "Table1" respectively for each select statement in my Store Procedure - I'd like to be able to specify my own TableName yet know what statement I'm naming...
In essence, I should be able to do this:
Console.WriteLine(ds.Tables["ProductList"].TableName);
Console.WriteLine(ds.Tables["CategoryList"].TableName);
Is there a consistant manner in which I can do this?