473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

One or more errors occurred during processing of commandORA-00971missing SET keyword

i am pasting the code in which i am finding the error
this is happening when i click on the update button of the datagrid which is fired when i click the edit button


Expand|Select|Wrap|Line Numbers
  1.         public void BindData()
  2.         {
  3.             OleDbDataAdapter da = new OleDbDataAdapter("SELECT *FROM CMRS_BUSINESSAREA_MASTER","Provider=MSDAORA.1;User ID=meter_reading;Password=colony;Data Source=windev;OLEDB.NET=true;" ); 
  4.             DataSet ds = new DataSet(); 
  5.             da.Fill(ds);
  6.  
  7.             DataGrid1.DataSource = ds.Tables[0].DefaultView ;
  8.             DataGrid1.DataBind();
  9.  
  10.  
  11.         }
  12.         public void Edit_DataGrid1(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) 
  13.         { 
  14.             // We use CommandEventArgs e to get the row which is being clicked 
  15.             // This also changes the DataGrid labels into Textboxes so user can edit them 
  16.             DataGrid1.EditItemIndex = e.Item.ItemIndex; 
  17.             // Always bind the data so the datagrid can be displayed. 
  18.             BindData(); 
  19.         } 
  20.         public void Cancel_DataGrid1(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) 
  21.         { 
  22.             // All we do in the cancel method is to assign '-1' to the datagrid editItemIndex 
  23.             // Once the edititemindex is set to '-1' the datagrid returns back to its original condition 
  24.             DataGrid1.EditItemIndex = -1; 
  25.             BindData(); 
  26.         } 
  27.         public void Update_DataGrid1(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
  28.         {
  29.             //try
  30.             //{
  31.  
  32.                 string str = ConfigurationSettings.AppSettings["ConnectionString"].ToString();
  33.                   OleDbConnection con1 = new OleDbConnection();
  34.                     con1.ConnectionString = str;
  35.  
  36.  
  37.                 TextBox txtAREADESCRIPTION =(TextBox) e.Item.Cells[1].Controls[0];
  38.                 string strUpdateStmt;
  39.  
  40.                 strUpdateStmt = "UPDATE CMRS_BUSINESSAREA_MASTER SET" + "CBM_BUSAREA_DESC = '" + txtAREADESCRIPTION.Text + "' " + "WHERE CBM_BUSAREA_CODE = " + e.Item.Cells[0].Text;
  41.                 Response.Write("strUpdateStmt");
  42.                 cmd = new OleDbCommand(strUpdateStmt,con1);
  43.                 con1.Open();
  44.                 cmd.ExecuteNonQuery();         
  45.                 DataGrid1.EditItemIndex = -1;
  46.                 BindData();
  47.             }
  48.             //catch(Exception e)
  49.             //{
  50.             //    Console.WriteLine(e.Message.ToString());
  51.             //}
  52.             //}
  53.  
  54.  
  55.         #region Web Form Designer generated code
  56.         override protected void OnInit(EventArgs e)
  57.         {
  58.             //
  59.             // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  60.             //
  61.             InitializeComponent();
  62.             base.OnInit(e);
  63.         }
  64.  
  65.         /// <summary>
  66.         /// Required method for Designer support - do not modify
  67.         /// the contents of this method with the code editor.
  68.         /// </summary>
  69.         private void InitializeComponent()
  70.         {    
  71.             this.cmd = new System.Data.OleDb.OleDbCommand();
  72.             this.con1 = new System.Data.OleDb.OleDbConnection();
  73.             this.addbtn.Click += new System.EventHandler(this.addbtn_Click);
  74.             this.updtbtn.Click += new System.EventHandler(this.updtbtn_Click);
  75.             this.delbtn.Click += new System.EventHandler(this.delbtn_Click);
  76.  
  77.             this.Load += new System.EventHandler(this.Page_Load);
  78.  
  79.         }
  80.         #endregion
  81.  
  82.         private void addbtn_Click(object sender, System.EventArgs e)
  83.         {
  84.             string str = ConfigurationSettings.AppSettings["ConnectionString"].ToString();  
  85.  
  86.             OleDbConnection con1 = new OleDbConnection();
  87.             con1.ConnectionString = str;
  88.             OleDbCommand cmd = new OleDbCommand("Insert into cmrs_businessarea_master values('"+TextBox1.Text+"','"+TextBox2.Text+"')",con1);         
  89.             con1.Open();
  90.             cmd.ExecuteNonQuery();
  91.             con1.Close();
  92.             BindData();
  93.  
  94.  
  95.         }
  96.  
Jul 24 '07 #1
2 870
radcaesar
759 Expert 512MB
Syntax error in append statement, ur append statement should start like this

strUpdateStmt = "UPDATE CMRS_BUSINESSAREA_MASTER SET CBM_BUSAREA_DESC =" + strUpdateStmt +..........
Jul 24 '07 #2
Plater
7,872 Expert 4TB
Actually I believe it is complaining because there is not a space after SET
so you get
..."SETCBM_BUSAREA_DESC"... instead of
..."SET CBM_BUSAREA_DESC"...
Jul 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
1
by: DB_2 | last post by:
Hello, I created the following stored procedure. (Please ignore the logic in it; at this point it is not complete and I am trying to get the basic structure working first.) CREATE PROCEDURE...
3
by: fred bliss | last post by:
Hi All We have a new server running the latest framework, windows server 2003 & IIS 6.0, and we're getting the following error when we try to load the app in IE. Server Error in...
5
by: | last post by:
Unfortunately I've used exception handling as a debugging tool. Now I want to be smarter about handling errors. Today in the global.asx in the Application_OnError event, I inserted code to email...
5
by: genc_ymeri | last post by:
Hi over there, We are a team of 6 developping web applications (ASP.Net/C#/VB.Net/SQLServer). What happens is that randomly, each of us get the below error in (PS). We believe that the "acess is...
8
by: Mark A. Sam | last post by:
Hello I am working locally with Visual Web Developer 2005 Express. Before I even installed it, the information from Microsoft was that you could FTP it to a remote site and it should work. The...
0
by: smkkaleem | last post by:
I am stuck with the error I have posted above in the question title I am developing ASP.NET 2.0 web site and I have added a new rdlc file to my project by using the following process: -Right...
0
by: David Lozzi | last post by:
Howdy, I get the error message as displayed below. I'm using Visual Studio 2003 on WinXP Pro SP2 workstation. I'll be sitting here happily developing when all of a sudden blamo this error will...
0
by: AnalogKid17 | last post by:
<full error> An error has occurred during report processing. Exception has been thrown by the target of an invocation. Login failed for user '\$'. </full error> I have a web based winforms app...
1
by: Willard Farwark | last post by:
DB2 7.2. I do an export each night of important tables. Nothing else should be touching the DB at this time. About every 2 days I get the error below on the same tables most of the time. What...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.