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 = ""


        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


    End Sub

Edited by swathys: n/a

5 Years
Discussion Span
Last Post by Oxiegen

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.

Votes + Comments
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.