本文介绍了异常错误-操作必须使用可更新的查询.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么出现此异常错误.

我的CS代码在下面给出

Why this Exception error is giving.

My CS code is given below

void sub(Object s, EventArgs e)
{
   con.Open();
   com=con.CreateCommand();
   com.CommandText="UPDATE cv SET name = '" + t1.Text.Trim() + "',pass='" + t3.Text.Trim() + "',pdob='" + t5.Text.Trim() + "',mob='" + t6.Text.Trim() + "',psex='" + d1.SelectedItem.Text.Trim() + "',pstatus='" + d2.SelectedItem.Text.Trim() + "',address='" + tax.Value + "',cobj='" + t7.Text.Trim() + "',eque='" + t8.Text.Trim() + "',etype='" + d1.SelectedItem.Text.Trim() + "',eyear='" + t9.Text.Trim() + "',edur='" + t10.Text.Trim() + "',sind='" + d1.SelectedItem.Text.Trim() + "',sjob='" + t11.Text.Trim() + "',scom='" + t12.Text.Trim() + "',sdate='" + t13.Text.Trim() + "',sdur='" + t14.Text.Trim() + "' where email='" + t2.Text.Trim() + "'";
   try{
      com.ExecuteNonQuery();
      System.Web.UI.WebControls.Label lbl1=new System.Web.UI.WebControls.Label();
      lbl1.ForeColor=System.Drawing.Color.Yellow;
      lbl1.BackColor=System.Drawing.Color.Blue;
      lbl1.Text="Your record UPDATED sucessfully";
      ph1.Controls.Add(lbl1);
   }
   catch(Exception ex)
   {
      Response.Write(ex.Message);
   }
      con.Close();
   }

推荐答案



这篇关于异常错误-操作必须使用可更新的查询.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 11:44