There's Webservice api that I design, Each time I push data cross the webservice this is what I get in return MOV = "Violation of PRIMARY KEY constraint 'PK_Vehicle_Transactions'. Cannot insert duplicate key in object 'dbo.Vehicle_Transactions'. The statement has been terminated." is like the api doesn't know where it stopped and where to continue! kindly see my source code below thanks
Public Sub uploadVehicle_Transaction()
Try
'do for sync indacator for proper upload in action
Dim VT As New DataTable
VT = New Statn_Sync.DataSetTableAdapters.Vehicle_TransactionsTableAdapter().GetData()
For Each dr As DataRow In VT.Rows
Dim iCount As Integer = 0
Dim MOV As String = comT.insertVehicle_Transaction(Convert.ToInt64(dr("TransactionID")), _
Convert.ToDateTime(dr("Transaction_date")), _
Convert.ToInt32(dr("Bank")), _
Convert.ToString(dr("Teller_number")), _
Convert.ToInt32(dr("Amount")), _
Convert.ToString(dr("Generated_by")), _
Convert.ToString(dr("Station")), _
Convert.ToString(dr("Customer_name")), _
Convert.ToInt32(dr("Transaction_category")), _
Convert.ToString(dr("Deposit_slip")), _
Convert.ToInt32(dr("Sync")), _
Convert.ToDecimal(dr("Penalty")), _
Convert.ToDecimal(dr("OGSG")), _
Convert.ToDecimal(dr("CMR")), _
Convert.ToDecimal(dr("Goshen")), _
Convert.ToDecimal(dr("Insurance")), _
Convert.ToDecimal(dr("OCost")), _
Convert.ToDecimal(dr("OGSG_Renewal")), _
Convert.ToDecimal(dr("De_pulse")))
iCount += 1
Label1.Text = " Auto Sync: " & iCount
'update record
Dim pls As String = dr("TransactionID").ToString
If (pls Is MOV) Then
AddToLog((Convert.ToString(": transferred") & MOV.ToString() & Text) + Environment.NewLine)
vta.UpdateTrans(dr("TransactionID"))
End If
Next
Catch ex As Exception
AddToLog(ex.Message.ToString)
End Try
End Sub