SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question aspnet c# objCmd.ExecuteNonQuery(); error why can anyone help

    The error below is on my server using odbc drivers for access but on local and on my server I am recieving this error can anyone tell me why
    example link also:
    http://anointedvesseldanceministry.o.../Default5.aspx
    try to update and you will see the error.

    http://anointedvesseldanceministry.o.../Default5.aspx
    Syntax error in UPDATE statement.
    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.OleDb.OleDbException: Syntax error in UPDATE statement.

    Source Error:


    Line 65: objCmd.Parameters.Add("@textbox1", txttextbox1.Text);
    Line 66: objConn.Open();
    Line 67: objCmd.ExecuteNonQuery();
    Line 68: objConn.Close();

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Moved this to the .NET forum.

    Anyhow, .NET is very good at telling you what your error is, you just need to read it right. In your case, there is a syntax error in your update statement that must be addressed. Presuming you are using SQL server, the best thing to do is to copy the SQL command into the appropriate SQL server tool (management studio or Query Analyizer depending on version) and check the syntax. IT should help you pin things down.

  3. #3
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can we see your Update query? The page is reporting that the Update command you have passed via the OleDbCommand object is wrong.

    What version is your access database?



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •