I have no idea why I'm having so much trouble finding this but I cannot find the code I'm looking for. It seems as though it should be simple.
Anyway, all I want to do is take a boolean field from my database that stores either a 1 or a 0, and display this in my datagridview with a checkbox column. Checked for 1, Unchecked for 0.
Currently, I have a datagrid and am just populating it with my dataset. It currently displays all the columns correctly except the last one "Confirmed" that just shows the 1 or the 0 that is stored in it.
How can I change the type of column for the "Confirmed" column to show checkboxes, and then populate these checkboxes based on the 1 or 0 in the database?
Thank you!
VB.NET 2010
Anyway, all I want to do is take a boolean field from my database that stores either a 1 or a 0, and display this in my datagridview with a checkbox column. Checked for 1, Unchecked for 0.
Currently, I have a datagrid and am just populating it with my dataset. It currently displays all the columns correctly except the last one "Confirmed" that just shows the 1 or the 0 that is stored in it.
How can I change the type of column for the "Confirmed" column to show checkboxes, and then populate these checkboxes based on the 1 or 0 in the database?
Thank you!
Code:
Dim sqlSx As String
sqlSx = "SELECT sxBookID, AviClientID, AviPetId, Date, Type, LastName, FirstName, PetName, Breed, Notes, VaccStatus, Phone1, Phone2, Confirmed FROM sxBook"
Dim daSx As New SqlDataAdapter(sqlSx, SqlConnPetVillage)
Dim dsSx As New DataSet
SqlConnPetVillage.Open()
daSx.Fill(dsSx, "sxBook")
grdSx.DataSource = dsSx.Tables("sxBook")
VB.NET 2010