Hello everyone,I'm a beginner in VB.NET. The following is my code,I'm migrating this module from VB to VB.NET. I'm really no idea with the messagebox pop-up written this= “Exception has been thrown by the target of an invocationâ€. Anyone can give me a help how to solve this problem please give me a solution,I have tried many times but still pop-up the same error. Hope someone can give me a help.
Thanks~!
Code:
Private Sub Sent_MT()
Dim conStr As String
Dim DB As String
Dim sql As String
Dim strURL, str As String
Try
If Telco = 2 Then
Call get_time()
MT_Msg = padQuotes(MT_Msg)
conStr = "server=(local);database=Drexler;integrated security=true;"
If Maxis_price <> "000" Then
sql = "Insert into " & Maxis_Table & "(Appid,trackid,sendernumber)values("
sql = sql & "'3085'" & " " 'AppId
sql = sql & "'" & Trace_Id & "'," 'TrackId
sql = sql & "'" & OriginatingAddress & "'," 'SenderNumber
sql = sql & ")"
Else
sql = "Insert into " & Maxis_Table & "(Appid,trackid,sendernumber)values("
sql = sql & "'3085'" & " " 'AppId
sql = sql & "'" & Trace_Id & "'," 'TrackId
sql = sql & "'" & OriginatingAddress & "'," 'SenderNumber
sql = sql & ")"
End If
ElseIf Telco = 6 Then
MT_Msg = URLencode(MT_Msg)
sql = "INSERT INTO " & Digi_Table & "(cpa_keyword,cpa_destination_mobtel,cpa_delivery_channel,cpa_content) VALUES ("
sql = sql & "'" & Service_Name & "',"
sql = sql & OriginatingAddress & "',"
sql = sql & "'SMS',"
sql = sql & "'" & MT_Msg & "',"
sql = sql & " )"
Obcomm10 = New SqlCommand(sql)
Obconn10 = New SqlConnection(conStr)
Obconn.Open()
Obcomm10.ExecuteNonQuery()
Obconn10.Close()
Obconn10.dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub