tags:

views:

25

answers:

1

Is there way to insert null into mysql from an empty text field in vb.net

thanks..

A: 

Assuming you are using ADO.NET, OleDb and parameters, you need to set the value to DBNull.Value

Example:

Using cmd As New OleDb.OleDbCommand()
//... set connection string etc

    cmd.Parameters.Add("myFieldName", OleDbType.VarWChar)
    cmd.Parameters("myFieldName").Value = DBNull.Value

//... etc

End Using
hawbsl