Hii
I am attaching the command
SqlCommand cmd = new SqlCommand("select SUM(cast(UserIncomeDetail_Amount as int)) as amount from ft_UserIncomeDetail where User_Uniq='Harish'", con);
con.Open();
sda=cmd.ExecuteReader();
if (sda != null)
{
ViewBag.income = sda["amount"];
}
error-
System.InvalidOperationException: 'Invalid attempt to read when no data is present.'
please the fix issue
Laxmi Katti22 reputationPosted Oct 10, 2018, 7:41 PM EDT
Abhishek MishraRank #88 · 23.6K reputationPosted Oct 10, 2018, 9:34 PM EDT
Ruchi SharavatRank #1,714 · 885 reputationPosted Oct 10, 2018, 9:46 PM EDT