M
Michael
Hi,
This should be fairly simple, but it is driving me nuts. First off I have a
table in SQL Server, with a column of type "bit". This is meant to store a
answer to a Yes/No question.
I'm trying to display this stored value in SQL Server in a RadioButtonList
in ASP.NET. I have the value stored in ado.net DataSet, which I can
reference just like this
myDataSet.Tables(0).Rows(0)("my_bit_column")
My problem is, I don't know how to bind this result, to the RadioButtonList.
I would believe I need to use the RadioButtonList's methods FindByText or
FindByValue methods, and I've tried something like this...
RadioButtonList1.Items.FindByValue(CStr(myDataSet.Tables(0).Rows(0)("my_bit_
column"))).Selected = True
But I get this beautiful error.."System.NullReferenceException: Object
reference not set to an instance of an object."
Can anyone help me out, it seems I'm making this more complicated that it
has to be!
Thanks!
--Michael
This should be fairly simple, but it is driving me nuts. First off I have a
table in SQL Server, with a column of type "bit". This is meant to store a
answer to a Yes/No question.
I'm trying to display this stored value in SQL Server in a RadioButtonList
in ASP.NET. I have the value stored in ado.net DataSet, which I can
reference just like this
myDataSet.Tables(0).Rows(0)("my_bit_column")
My problem is, I don't know how to bind this result, to the RadioButtonList.
I would believe I need to use the RadioButtonList's methods FindByText or
FindByValue methods, and I've tried something like this...
RadioButtonList1.Items.FindByValue(CStr(myDataSet.Tables(0).Rows(0)("my_bit_
column"))).Selected = True
But I get this beautiful error.."System.NullReferenceException: Object
reference not set to an instance of an object."
Can anyone help me out, it seems I'm making this more complicated that it
has to be!
Thanks!
--Michael