简体   繁体   中英

SP returning output but SqlDataReader/SqlDataAdapter not

I am using SP in C# project to retrieve the output using SqlDataReader. Below is the code.

在此处输入图片说明

It is very Simple SP with the select statement. SP return the output when executed from SQL 2014 but when implemented in the above method it doesn't return any output. Both of them has same parameters and DB pointing to the correct server and DB Below is the screen for reference.

SP的屏幕截图 It is returning count 43. But in the code it is empty.

Kindly help.

Why not use SqlDataReader instead of SqlDataAdapter ?

using(SqlDataReader reader = _oCmd.ExecuteReader())
{
    DataTable dataTable = new DataTable();
    dataTable.Load(reader);

    objLMT = ConvertTo<LMTUsage>(dataTable);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM