I get a ‘Conversion from type DBNull to String is not valid’ error when I proceed to insert the row with a null cell value from my program to MS Sql Server even if the column is already set to accept null values in the database. How do I solve this?
FYI I’m using an unbound datagrid, and I get all the screen values during runtime.
Property SerialNo()
Get
Return strSerialNo
End Get
Set(ByVal value)
strSerialNo = value <-----this is where I get the error
End Set
End Property
You should declare a type for your property: