Why this error:: There is no row at position 0.?
DataSet dsQues = obj.getQues();
txtQues开发者_StackOverflow.Text = dsQues.Tables[0].Rows[0]["Ques"].ToString(); //error here
I think, you are not setting the value of @QuesID parameter in your code. And in the database there is no row having QuesID as NULL.
becoz
dsFAQ.Tables[0].Rows is a empty collection , please check your SP is returning some rows or not
Or that there is no column "FAQs".
Please check that your obj.getFAQ() is returning values.
Maybe try to execute in debug mode with a break point at the problematic line and try to see what is in your DataSet.. Probably IT is empty!
It means that you have an empty DataSet (or that you're referencing an empty table in the DataSet).
I'm guessing the root cause is that the Stored Procedure backing you calls is returning zero rows. You're not passing any parameters to the Procedure, so you could try running this query by hand and seeing how many rows come back:
SELECT * FROM Admin.Ques WHERE QuesID = NULL
精彩评论