ls_sql="update dba.custom_contact ";
ls_sql=ls_sql+ "set  re=\'"+TEXTAREA1.Value.ToString()+"\' ";
ls_sql=ls_sql+" where custno=\'"+this.cs_custno+"\'";
try
{
System.Data.OleDb.OleDbCommand updatecmd= new 
 System.Data.OleDb.OleDbCommand(ls_sql,this.oleDbConnection1);
 this.oleDbConnection1.Open();
   if  (updatecmd.ExecuteNonQuery()>0)
{ this.msg_box("udpate successfully");}
}
     catch (System.Exception  e)
     {
this.msg_box(ls_sql);
this.msg_box("数据存盘出错,请与系统管理员联络!"+e.Message);
    }

解决方案 »

  1.   

    不好意思,写错了,代码应如comy(泥娃)所示, 语法本身没问题,就是不明是什么问题!
      

  2.   

    write out the sql statement, run it manually in the query tool for your database to make sure it worksResponse.Write("****" + ls_sql+"***<BR>");if you are using Access, make sure you give ASPNET account write permissions on the database file and the directory it is in
      

  3.   

    Many thanks  for saucer's  kind answer , I'm sure my SQL statement is correct. the
    main problem may that  my database is  Sybase ASA7.03 , it's may not very get
    well with oledb in .net platform. I gave up oledb connection and changed to 
    ODBC, it's looks working.Thanks for all again.