Hello there, I have 2 tables in my database, all i want to do is when the time txtJobstart is null then it will not insert the data to the tbl2 but all the data from other fields will save to tbl1.
Code:
If txtJobStart.Text = "" Then
'Don't save, do nothing
Else
Dim constr As String = ConStrX
Using test As New SqlConnection(constr)
Using probe As New SqlCommand("JobStartMonitoring")
Using sda As New SqlDataAdapter()
probe.CommandType = CommandType.StoredProcedure
probe.Parameters.AddWithValue("@JobStart", txtJobStart.Text)
probe.Parameters.AddWithValue("@TotalNoOfPins", txtTotalPins.Text)
probe.Parameters.AddWithValue("@TotalNoOfJobs", txtTotalJO.Text)
probe.Connection = test
test.Open()
probe.ExecuteNonQuery()
test.Close()
End Using
End Using
End Using
End If
Comment