i have a problem with my insert function using web services.i can't figure out where to fix.....does anyone have idea abt it ????

this is the error is when i run the web services

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/Update_TransactionRecords'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/Update_TransactionRecords'.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +405961
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
   System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

this is my insert statement

<WebMethod()> _
    Public Sub Update_TransactionRecords(ByVal ID As String, ByVal CurrentTranxDateTime As DateTime, ByVal NAME As String, ByVal ACCNO As String, ByVal BILLNO As String, ByVal BILLAMO As String, ByVal BILLINT As String, ByVal BILLTOT As String, ByVal Payment As Double)

        'Dim strSQL As String = ""

        OpenConnection()

        strSQL = "INSERT INTO dbo.TransactionRecord([ID],[TransactionDate],[Name],[AccountNo],[BillNo],[BillAmount],[ServiceCharge],[TotalAmount],[Commission]) VALUES ('" & ID & "','" & CurrentTranxDateTime & "','" & NAME & "','" & ACCNO & "','" & BILLNO & "','" & BILLAMO & "','" & BILLINT & "','" & BILLTOT & "','" & Format(Payment, "0.00") & "')"

        cmd.CommandText = strSQL
        cmd.ExecuteNonQuery()

        cmd.Dispose()
        CloseConnection()


    End Sub

Why not convert the method into a function that returns a string.
And then enclose the code in a Try...Catch statement.
If the code should fail, then you can return the .ToString() of the exception object and examine what went wrong.
Otherwise you just return an empty string.

commented: tq +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.