string strText = Text.text(); SqlCommand mycom = new SqlCommand("update shipping_detail set carrier="strText" where container_id='" + a + "'", con); 这样吗?
可以这样写,里面的数据库字段我都默认为是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);
string strText = Text.text(); SqlCommand mycom = new SqlCommand("update shipping_detail set carrier=" + strText + " where container_id='" + a + "'", con);
刚才上面的漏了引号string strText = Text.text(); SqlCommand mycom = new SqlCommand("update shipping_detail set carrier='" + strText + "' where container_id='" + a + "'", con);
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);
SqlCommand mycom = new SqlCommand("update shipping_detail set carrier="strText"
where container_id='" + a + "'", con);
这样吗?
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);
SqlCommand mycom = new SqlCommand("update shipping_detail set carrier=" + strText + "
where container_id='" + a + "'", con);
SqlCommand mycom = new SqlCommand("update shipping_detail set carrier='" + strText + "'
where container_id='" + a + "'", con);