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. syntax error

syntax error

Scheduled Pinned Locked Moved ASP.NET
help
8 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.
  • C Offline
    C Offline
    chubbie
    wrote on last edited by
    #1

    when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-

    R G V E 4 Replies Last reply
    0
    • C chubbie

      when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-

      R Offline
      R Offline
      Ritesh1234
      wrote on last edited by
      #2

      What Error it gives.............

      C 1 Reply Last reply
      0
      • C chubbie

        when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        The error comes from the database, so your error is where you create the sql query. --- b { font-weight: normal; }

        C 1 Reply Last reply
        0
        • C chubbie

          when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-

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

          Inspect the commandObject.commandText property. That should give you some guideline. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
          http://deepakvasudevan.blogspot.com/
          http://deepak.blogdrive.com/

          1 Reply Last reply
          0
          • C chubbie

            when i run my application, the program hinted me.. highlighting commandObj2.ExecuteNonQuery(); telling me it have a syntax error near ''.. i was puzzle as to where this error comes from, or where did i go wrong. -DarkangeL-

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            debug it and copy the sql query and run it in sql query analyzer to see if it works... << >>

            1 Reply Last reply
            0
            • R Ritesh1234

              What Error it gives.............

              C Offline
              C Offline
              chubbie
              wrote on last edited by
              #6

              Incorrect syntax near ' '.

              Line 716: SqlCommand commandObj2 = new SqlCommand(UpdateData, connectObj2);
              Line 717: connectObj2.Open();
              Line 718: commandObj2.ExecuteNonQuery();
              Line 719: connectObj2.Close();

              Stack Trace:

              [SqlException (0x80131904): Incorrect syntax near ' '.]
              System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
              System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
              System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
              System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
              System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +272
              System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +367
              System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
              AdminView.Button1_Click(Object sender, EventArgs e) in d:\testApplication\AdminEdit.aspx.cs:718
              System.Web.UI.WebControls.Button.OnClick(EventArgs e) +96
              System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +116
              System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
              System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
              System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72
              System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840

              this is the error page it gives me. -DarkangeL-

              1 Reply Last reply
              0
              • G Guffa

                The error comes from the database, so your error is where you create the sql query. --- b { font-weight: normal; }

                C Offline
                C Offline
                chubbie
                wrote on last edited by
                #7

                hmm.. mind explaining it in more details.? -DarkangeL-

                G 1 Reply Last reply
                0
                • C chubbie

                  hmm.. mind explaining it in more details.? -DarkangeL-

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  The syntax error is in the SQL query that you send to the database. Examine the code where you create the SQL query. --- b { font-weight: normal; }

                  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