Hi,
I have the follwoing code;
I am trying to add these values to a table in SQL database.Code:query = "INSERT INTO dbo.TblPracExclude (prac_no, Goldpracid) VALUES (" & _ chk_prac_no & ", '" & _ DgvPracExcl.Rows(RowID).Cells(1).Value & "')" cmd = New SqlCommand(query, conn1) cmd.ExecuteNonQuery()
The problem am facing is that DgvPracExcl.Rows(RowID).Cells(1).Value is empty so this inserts an empty string to the database.
Instead I want it to insert a NULL value.
Is this possisble?
Thanks




Reply With Quote