1
Open Discussion / Re: Combobox selection value
« on: January 02, 2021, 03:53:22 PM »
Thanks Archie
Works
Works
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Private Sub DataSubscriber25_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber25.DataChanged
If e.ErrorId = 0 Then
If e.Values(0) = True Then
Using Con As New SqlConnection("Data Source=192.168.100.100;Initial Catalog=DB;Persist Security Info=True;User ID=Tarzan;Password=****")
Dim command As New SqlCommand("insert into dbo.Products(UPID, XPOS, YPOS, Error, Employee, Employee2) values(@UPID, @xpos, @ypos, @error, @employee, @employee2)", Con)
command.Parameters.Add("@UPID", SqlDbType.Int).Value = BasicLabel16.Value
command.Parameters.Add("@xpos", SqlDbType.Int).Value = BasicLabel2.Value
command.Parameters.Add("@ypos", SqlDbType.Int).Value = BasicLabel3.Value
command.Parameters.Add("@error", SqlDbType.Int).Value = BasicLabel4.Value
command.Parameters.Add("@employee", SqlDbType.Int).Value = BasicLabel5.Value
command.Parameters.Add("@employee2", SqlDbType.Int).Value = BasicLabel33.Value
If Con.State.ToString <> "Open" Then
Con.Open()
End If
command.ExecuteNonQuery()
If command.ExecuteNonQuery() <> 1 Then
Con.Close()
Con.Dispose()
End If
End Using
EthernetIPforCLXCom1.Write("DB_Tricker_1", 0)
End If
End If
End Sub
/Holmux