Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can I know the location of error by Stack Trace given?

How can I know the location of error by Stack Trace given?

Scheduled Pinned Locked Moved ASP.NET
questiondata-structuresdebugginghelp
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miss nadia
    wrote on last edited by
    #1

    I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

    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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.

    Stack Trace:

    [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
    System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
    System.Data.SqlClient.SqlDataReader.get_MetaData() +62
    System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
    System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
    System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
    System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
    Syst

    N V C H 4 Replies Last reply
    0
    • M miss nadia

      I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

      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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.

      Stack Trace:

      [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
      System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
      System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
      System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
      System.Data.SqlClient.SqlDataReader.get_MetaData() +62
      System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
      System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
      System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
      System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
      System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
      System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
      System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
      System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
      Syst

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      miss nadia wrote:

      There's no given location for the specific error

      It would be in the query you given in SQLDataSource.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      1 Reply Last reply
      0
      • M miss nadia

        I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

        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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.

        Stack Trace:

        [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
        System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
        System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
        System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
        System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
        System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
        System.Data.SqlClient.SqlDataReader.get_MetaData() +62
        System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
        System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
        System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
        System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
        System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
        System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
        System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
        System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
        System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
        System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
        Syst

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        miss nadia wrote:

        How can I know the location

        Walking through the StackTrace, doesn't it indicate the affected classes from your application?

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        N 1 Reply Last reply
        0
        • V Vasudevan Deepak Kumar

          miss nadia wrote:

          How can I know the location

          Walking through the StackTrace, doesn't it indicate the affected classes from your application?

          Vasudevan Deepak Kumar Personal Homepage
          Tech Gossips
          A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Vasudevan Deepak Kumar wrote:

          Walking through the StackTrace, doesn't it indicate the affected classes from your application?

          I doubt, since OP uses nasty SQLDataSource for binding.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

          V M 2 Replies Last reply
          0
          • N N a v a n e e t h

            Vasudevan Deepak Kumar wrote:

            Walking through the StackTrace, doesn't it indicate the affected classes from your application?

            I doubt, since OP uses nasty SQLDataSource for binding.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            V Offline
            V Offline
            Vasudevan Deepak Kumar
            wrote on last edited by
            #5

            True. And for a beginner, it would be a significantly scary.

            Vasudevan Deepak Kumar Personal Homepage
            Tech Gossips
            A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

            1 Reply Last reply
            0
            • M miss nadia

              I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

              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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.

              Stack Trace:

              [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
              System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
              System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
              System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
              System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
              System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
              System.Data.SqlClient.SqlDataReader.get_MetaData() +62
              System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
              System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
              System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
              System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
              System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
              System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
              System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
              System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
              System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
              System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
              Syst

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              The error is obvious. How many places do you use the keyword 'order' in your code ? Perhaps if you post your SQL we can help ?

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              M 2 Replies Last reply
              0
              • M miss nadia

                I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.

                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.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.

                Stack Trace:

                [SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
                System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
                System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
                System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
                System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
                System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
                System.Data.SqlClient.SqlDataReader.get_MetaData() +62
                System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
                System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
                System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
                System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
                System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
                System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
                System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
                System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
                System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
                System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
                Syst

                H Offline
                H Offline
                Herman T Instance
                wrote on last edited by
                #7

                I guess I would add a space after the word Order. I guess that you concatenate strings like String query = String.Empty; query += "Select * FROM Order"; query += "Where Value = 1"; if you would check the content of the string query it would read: Select * FROM OrderWhere Value = 1 Maybe this makes your problem clear.

                1 Reply Last reply
                0
                • N N a v a n e e t h

                  Vasudevan Deepak Kumar wrote:

                  Walking through the StackTrace, doesn't it indicate the affected classes from your application?

                  I doubt, since OP uses nasty SQLDataSource for binding.

                  All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                  M Offline
                  M Offline
                  miss nadia
                  wrote on last edited by
                  #8

                  What does it means by OP? does this error looks complex? i hope it is not since i'm a beginner. i will post the codes and hope all of you will help.

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    The error is obvious. How many places do you use the keyword 'order' in your code ? Perhaps if you post your SQL we can help ?

                    Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                    M Offline
                    M Offline
                    miss nadia
                    wrote on last edited by
                    #9

                    I'm using Web User Control for Order.aspx file. This is SQL code for Order.ascx.

                    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                    SelectCommand="SELECT Order.OrderNum, Order.OrderDate, Order.CustEmail, Order.Subtotal, Order.Shipping, Order.Total,
                    Customers.LastName, Customers.FirstName, Customers.Address, Customers.City, Customers.State, Customers.PostCode, Customers.Phone, Customers.Country
                    FROM Order
                    INNER JOIN Customers
                    ON Order.CustEmail=Customers.Email
                    WHERE Order.OrderNum=@OrderNum
                    ORDER BY Order.OrderNum">
                    <SelectParameters>
                    <asp:SessionParameter Name="OrderNum" SessionField="OrderNum" Type="Int32" />
                    </SelectParameters>
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                    ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                    SelectCommand="SELECT [ProductId], [Name], [Price], [Quantity], [Total], [OrderNum]
                    FROM [OrderItems]
                    WHERE ([OrderNum]=@OrderNum)
                    ORDER BY [ProductId]">
                    <SelectParameters>
                    <asp:ControlParameter Name="OrderNum" ControlID="FormView1"
                    PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                    </asp:SqlDataSource>

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      The error is obvious. How many places do you use the keyword 'order' in your code ? Perhaps if you post your SQL we can help ?

                      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                      M Offline
                      M Offline
                      miss nadia
                      wrote on last edited by
                      #10

                      And this is code for Order.aspx. Incorrect syntax that I can't find. That makes me really worried!

                      <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" AutoEventWireup="False" %>
                      <%@ Register Src="~/Manage/Order.ascx" TagName="Order" TagPrefix="uc1" %>

                      <script runat="server">

                      Protected Sub Page\_Load(ByVal sender As Object, ByVal e As System.EventArgs)
                          If Not IsPostBack Then
                              ddlOrder.DataBind()
                          End If
                          Session("OrderNum") = ddlOrder.SelectedValue
                      End Sub
                      

                      </script>

                      <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
                      </asp:Content>
                      <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
                      Choose an order to display:
                      <asp:DropDownList ID="ddlOrder" runat="server" AutoPostBack="True"
                      DataSourceID="SqlDataSource1" DataTextField="OrderNum"
                      DataValueField="OrderNum">
                      </asp:DropDownList> 
                      <asp:LinkButton ID="LinkButton1" runat="server"
                      PostBackUrl="~/Manage/PrintOrder.aspx">Print this page</asp:LinkButton>
                      <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                      ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                      SelectCommand="SELECT OrderNum FROM Order ORDER BY OrderNum">
                      </asp:SqlDataSource><br /><br />
                      <uc1:Order ID="Order1" runat="server" />
                      </asp:Content>

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups