ASP.Net Checkbox
I want to retrieve the value from a database for a checkbox, the value in the db is 1 for checked and 0 for unchecked. At the moment the word 'True' is being displayed next to the checkbox rather than being checked. here is my code:
<asp:checkbox ID="txtProduct_Visible" runat="server" />
Sub LoadProduct()
Connect()
Dim strQuery As String = "SELECT ProdRange_Visible " & _
"FROM dbo.Product_Range WHERE ProdRangeID = " & Request("ProdRangeID")
Dim dbComm As New SqlCommand(strQuery, objConnection)
Dim reader As SqlDataReader = dbComm.ExecuteReader()
reader.Read()
txtProduct_Visible.Text = reader.GetValue(0)
reader.Close()
Disconnect()
End Sub
|