No idea what I'm doing wrong here, I have searched but cant find an answer online. I have a SQL database and I'm using VS 2015 Community edition I want to read the bit value of the database.
In this example some people can tow, some cannot. Previously this has been saved in the database by selection of a checkbox. So the database has three possible states, True, False and NULL
Gridview1 correctly shows a 'tick' in the correct box when previously saved as such. In this code example I have selected row 3 because I know that is checked. But the Messagebox shows empty "", it never shows True, false or even 0 or 1, it always shows a null value. I need to get the value of this gridview cell for further processing.
Here is the code -
Note - I have reduced the code to the relevant section (no Using, stop using etc)
Dim FD = From Person_data_Table In db.Person_data_tables, Date_Table In db.Date_Tables Select Person_data_Table.MK, Person_data_Table.Can_Tow, Person_data_Table.Can_Tow1 Distinct GridView1.DataSource = FD GridView1.DataBind() MsgBox(GridView1.Rows(3).Cells(1).Text)
If I select Cell 0 (any row) it correctly reads the MK value so the DB is valid and working etc,. - What I need is something like this, but right now it always answers with 'Nothing here
Dim test as string (0r something else?) = Gridview1.Rows(3).Cells(1).text
If test = "" Then MsgBox("nothing here") ElseIf test = "True" Then MsgBox("Ticked") Else MsgBox("not ticked") End If
Any help much appreciated as ever
regards
Peter