1. You posted the same thing
yesterday[
^]
2. Though we asked you about your table structure/query thats fetching the result, you didnt replied that. Instead repost the same thing.
It's clear from the error that either a column named 'Answer' does not exists in the table you are accessing OR 'Answer' was not selected in your query.
Correct the issue, based on which ever reasons is true.
UPDATE SM:
mudassir 1988 wrote:
BEGIN SELECT PK_PollId, Question FROM pol_question WHERE Active+0 = '1' ; SELECT PK_OptionId, Answer, Votes FROM polloptions WHERE FK_PollId IN (SELECT PK_PollID FROM pol_question WHERE Active+0 = '1'); END
Here you go! You have two select statements in your Stored Procedure. Thus the dataset returned will have two tables and the second table would have this 'Answer' column. Look at your code, you are trying to access the 'Answer' column in first table.
Try accessing like this:
foreach (DataRow dr in ds.Tables[1].Rows)
{
rdoPollOptionList.Items.Add(dr["Answer"].ToString());
}