asp.net +c#+sql2000
错误发生在记录更新的时候,
错误提示为:
: 第 1 行: '=' 附近有语法错误。源错误:
行 90: SqlCommand Cmd_webedit=new SqlCommand(sql_webedit,Con);//这一行提示错误:
行 91: Cmd_webedit.Connection.Open();
行 92: Cmd_webedit.ExecuteNonQuery();
行 93: Cmd_webedit.Connection.Close(); 部分源代码如下:
在Page_Load里已经初始化
public string sid;//获得记录id号, Taxis.Text= editinformation["Taxis"].ToString();//获得更新记录的数据sid=Request.Params["showid"];
//点击更新按钮的函数
public void editinfomation(object Source, EventArgs e)
{
SqlConnection Con = new SqlConnection("Data Source=HELLO;Initial Catalog=Digital;User ID=sa;Pwd=;");
string sql_webedit="update webdata set Taxis='"+Taxis.Text+"' where ID="+sid;
SqlCommand Cmd_webedit=new SqlCommand(sql_webedit,Con);
Cmd_webedit.Connection.Open();
Cmd_webedit.ExecuteNonQuery();
Cmd_webedit.Connection.Close();
Response.Redirect("webmanager.aspx") ;
}请大家指教!!!!!!!!!!!
错误发生在记录更新的时候,
错误提示为:
: 第 1 行: '=' 附近有语法错误。源错误:
行 90: SqlCommand Cmd_webedit=new SqlCommand(sql_webedit,Con);//这一行提示错误:
行 91: Cmd_webedit.Connection.Open();
行 92: Cmd_webedit.ExecuteNonQuery();
行 93: Cmd_webedit.Connection.Close(); 部分源代码如下:
在Page_Load里已经初始化
public string sid;//获得记录id号, Taxis.Text= editinformation["Taxis"].ToString();//获得更新记录的数据sid=Request.Params["showid"];
//点击更新按钮的函数
public void editinfomation(object Source, EventArgs e)
{
SqlConnection Con = new SqlConnection("Data Source=HELLO;Initial Catalog=Digital;User ID=sa;Pwd=;");
string sql_webedit="update webdata set Taxis='"+Taxis.Text+"' where ID="+sid;
SqlCommand Cmd_webedit=new SqlCommand(sql_webedit,Con);
Cmd_webedit.Connection.Open();
Cmd_webedit.ExecuteNonQuery();
Cmd_webedit.Connection.Close();
Response.Redirect("webmanager.aspx") ;
}请大家指教!!!!!!!!!!!
我确认:Taxis 在数据库不是文本类型