G
Guest
Hey there
I know there's a simple answer to this Quesiton because I've asked it before (but I have not yet used it and have now forgotten what the answer was!) so..
I have a simple Datareader returning the value of a field from a SQL Server but if the field is blank, the application returns an error.
A piece of the code is as follows:
cmd = New SqlCommand("SELECT * FROM thisTable WHERE Email = '" & memberVariable & "'", cn)
rdr = cmd.ExecuteReader()
rdr.Read()
textField1.Text = rdr("column1")
textField2.Text = rdr("column2")
I remember the solution was something like
textField2.Text = rdr("column2") & ""
but this returns the same error.
Help!
I know there's a simple answer to this Quesiton because I've asked it before (but I have not yet used it and have now forgotten what the answer was!) so..
I have a simple Datareader returning the value of a field from a SQL Server but if the field is blank, the application returns an error.
A piece of the code is as follows:
cmd = New SqlCommand("SELECT * FROM thisTable WHERE Email = '" & memberVariable & "'", cn)
rdr = cmd.ExecuteReader()
rdr.Read()
textField1.Text = rdr("column1")
textField2.Text = rdr("column2")
I remember the solution was something like
textField2.Text = rdr("column2") & ""
but this returns the same error.
Help!