title: Error writing to SQL Database when user leaves field blank
body: <p>I am creating a windows form that the user will fill out whenever we add a new employee. If I fill in the form completely, I can write to the database, but if one field gets left blank, I get an error. In the SQL table, all rows are set to allow nulls, and I can insert via SQL Server Management Studio with null values with no problems.</p>
  
  <p>For brevity, I have left off a dozen or so fields, but the same error occurs if I replace this code with the code I am using.</p>
  
  <pre><code>Dim DBConnection As New SqlClient.SqlConnection
  Dim cmd As New SqlClient.SqlCommand
  Try
  WOWConnection.ConnectionString = "Server=MyServerName;Database=Employee Database;Trusted_Connection=TRUE;"
  WOWConnection.Open()
  cmd.Connection = WOWConnection
  cmd.CommandText = "INSERT INTO [dbo].[Employees]([FirstName],[LastName]) VALUES (@FirstName,@LastName)"
  cmd.Parameters.AddWithValue("@FirstName", Me.EMP_FirstName.Text)
  cmd.Parameters.AddWithValue("@LastName", Me.EMP_LastName.Text)
  cmd.ExecuteNonQuery()
  MsgBox("Sucess!")
  Catch ex As Exception
  MsgBox("error")
  Finally
  DBConnection.Close()
  End Try
  </code></pre>
  
  <p>How do you handle a field being left blank on a windows form?</p>