Converting RadioButtlonList Item to Boolean for entry to Database via LINQ
I am attempting to read items from local RadiobuttonList items and take
them as Boolean values and insert them to my database.
The problem the thread keeps getting aborted and I am not sure where I am
going wrong. So I was wondering if could have some help troubleshooting
this issue.
I have a method that reads in the Radiobuttonlist and should check if the
Yes option is selected and outputs whether a true or false: private
Boolean checkRB(RadioButtonList list) { Boolean value;
if (list.SelectedItem.Text == "Yes")
{
value = true;
}
else
{
value = false;
}
return value;
}
Next here is the line that i am using to insert the item to the database:
table rea = new table();
rea.another_inst = checkRB(rbAnotherInst);
Could anyone help me with trouble shooting this?
No comments:
Post a Comment