Connecting to a dynamic Stored procedure

Options

Hi,

I have a situation where I have an existing desktop windows application developed using .Net and crystal reports.

Report is pulling the data using Dataset, but the dataset is using dynamic table as shown below

public DataSet GetReportPayrollPrintCheckSource(int payrollID, DateTime checkDate, bool allEmployees, DataTable selectedEmployeeList)
{
IList<DbParam> parameters = new List<DbParam>
{
new DbParam("@PayrollID", (object)payrollID),
new DbParam("@CheckDate", (object)checkDate),
new DbParam("@AllEmployees", (object)allEmployees),
new DbParam("@EmployeeIDs", (object)selectedEmployeeList)
};
using (DatabaseHelper dh = new DatabaseHelper())
{
var results = dh.ExecDataSet(Constants.uspReportPayrollPrintCheckSource, parameters);
results.Tables[0].TableName = Constants.uspReportPayrollPrintCheckSource + ";1";
results.Tables[1].TableName = Constants.uspReportPayrollPrintCheckSource + ";2";
return results;
}
}

34829cf3998694819852dac929e938e3-huge-im

Stored procedure is having two select statements and the above data source is pulling data from the 2nd select statement (2nd dynamic table. hence the above name is showing as <dataset>;2)

I want to include another select statement withing the same stored procedure and pull the fields from the dynamic table with a new dataset as <dataset>;3, how can I achieve that?

Tagged:

Categories