samedi 9 mai 2015

Can't get stored procedure result

In my stored procedure with a cursor, I got the results but when I try to get that value into table I can't get it. Please help me.

Here is my C# code

string sql = "ForTaxReport";
tdsTPDPay.TaxReportRow dataRowLog = new tdsTPDPay.TaxReportDataTable().NewTaxReportRow();

if (base.Transaction != null)
{
    base.Command = new SqlCommand(sql, base.Connection, base.Transaction);
}
else
{
    base.Command = new SqlCommand(sql, base.Connection);
}

base.CommandType = CommandType.StoredProcedure;
base.Parameters.AddWithValue("@PayrollDate", GetNull(date));
base.Parameters.AddWithValue("@ID", GetNull(ID));

base.OpenConnection();
SqlDataAdapter adp = new SqlDataAdapter(base.Command);
tdsTPDPay.TaxReportDataTable dt = new tdsTPDPay.TaxReportDataTable();
adp.Fill(dt);
return dt;

Aucun commentaire:

Enregistrer un commentaire