有问题的吧……。
string strText = Text.text();
"carrier=Text.text()" 改成 "strText"

解决方案 »

  1.   

    string strText = Text.text();
    SqlCommand mycom = new SqlCommand("update shipping_detail set carrier="strText"
    where container_id='" + a + "'", con);
    这样吗?
      

  2.   

    可以这样写,里面的数据库字段我都默认为是varchar的了。
    string a = Request.QueryString["v"].ToString();
    SqlCommand mycom = new SqlCommand(String.Format("update shipping_detail set carrier='{0}'where container_id='{1}'",Text.text(),a), con);
      

  3.   

    string strText = Text.text();
    SqlCommand mycom = new SqlCommand("update shipping_detail set carrier=" + strText + "
    where container_id='" + a + "'", con);
      

  4.   

    刚才上面的漏了引号string strText = Text.text();
    SqlCommand mycom = new SqlCommand("update shipping_detail set carrier='" + strText + "'
    where container_id='" + a + "'", con);
      

  5.   

    SqlCommand mycom = new SqlCommand("update shipping_detail set carrier=@carrier where container_id='" + a + "'", con);SqlCommand mycom = new SqlCommand("update shipping_detail set carrier'"+变量+"' where container_id='" + a + "'", con);