I have found something on
but I'm not sure how to use it - do I need a stored procedure or not?
Here is what I have now:
(it gives an error: "Cast from type 'DBNull' to 'String' in not valid in String.Format("INSERT INTO Employees(FirstName, ...)
************************************
Private Sub InsertEmp()
Dim strSQL As String
Dim strConn As String
Dim sEvalLast As Object
strConn = Session("ConnectString"

.ToString
If txtEvalLast.Text = String.Empty Then
sEvalLast = Convert.DBNull ' or System.DBNull.Value
Else
sEvalLast = DataHandler.QuoteString(txtEvalLast.Text)
End If
strSQL = String.Format("INSERT INTO Employees(FirstName, LastName, " & _
"SupervisorID, DateLastEval) " & _
"VALUES({0}, {1}, {2}, {3}, {4}) ", _
DataHandler.QuoteString(txtFirstName.Text), _
DataHandler.QuoteString(txtLastName.Text), _
ddlSupervisor.SelectedItem.Value, _
DataHandler.QuoteString(sEvalLast))
DataHandler.ExecuteSQL(strSQL, strConn)
Response.Redirect("Employees.aspx"

End Sub
==================================================
Here is the
code.
I don't know how to use it in my case
**************************************
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandText = "INSERT INTO myTable (Name, RegisteredDate, CancelDate) " & _
"VALUES (@Name, @RegisteredDate, @CancelDate)"
cmd.Parameters.Add("@Name", "Doug Seven"

cmd.Parameters.Add("@RegisteredDate", DateTime.Today)
'Use System.DBNull.Value to leave the field uninitialized
cmd.Parameters.Add("@CancelDate", System.DBNull.Value)
'checking for null
If user.RegisteredDate = Nothing Then
cmd.Parameters("@RegisteredDate"

.Value = System.DBNull.Value
Else
cmd.Parameters("@RegisteredDate"

.Value = user.RegisteredDate
End If
*********************************************