My method:
[Function(Name = "get_values")]
[ResultType(typeof(Values_Result))]
public IMultipleResults getvaluesresult([Parameter(DbType = "Int")] System.Nullable<int> Id1, [Parameter(DbType = "VarChar(100)")] string Id2)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), Id1, Id2);
return ((IMultipleResults)(result.ReturnValue));
}
Method call:
var resultValues = cont1.getvaluesresult(Convert.ToInt32(clsSession.id1), "101");
var resultValuesList = resultValues.GetResult<Values_Result>().ToList<Values_Result>();
if (resultValuesList != null && resultValuesList.Count > 0)
{
var dataTable = resultValuesList.ToDataTable();
// performing some tasks
}
My stored procedure looks like this:
CREATE PROCEDURE get_values
(@Id2 VARCHAR(50),
@Id1 INT)
AS
BEGIN
DECLARE @temp TABLE (id INT)
INSERT INTO @temp
(SELECT id FROM table1)
SELECT * FROM table2
SELECT * FROM @temp
END
I want to know how to get the two returned tables from the stored procedure.
I don't want to join the tables in the stored procedure as one