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.
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.