hello you there :)
i run stored procedure from ASP.NET that return me 2 Tables
for example, this is the Stored Procedure Code:
////////////////////////////
CREATE PROCEDURE dbo.sp_Info
AS
SELECT *
FROM dbo.Employees
SELECT *
FROM dbo.Orders
GO
///////////////////////////
the problem is when i try to use the myDataSet.Tables["Table"];
i want to use the real name of Tables tables and not like Tables["Table"]
is someone have an idea?
thanks alot,
elad
Mohan PalaniappanPosted Jul 27, 2006, 9:02 AM
Hi Elad,
I Guess you will use Adapter class to fill the data returned by the Sql procedure in the dataset, If so here is my solution:
SqlDataAdapter adpt = new SqlDataAdapter(Procedure Name);
SqlCommand cmd = new SqlCommand();
MyDataSet.Tables.Add("Employee");
MyDataSet.Tables.Add("Orders");
adpt.Fill(MyDataSet);
Now you can access the rows for the corresponding tables as,
MyDataSet.Tables["Employee"].Rows[0][ColumnName].ToString()....
Hope You got some clue out of it. Try out and get back to me.
Regards