string strconn=ConfigurationSettings.AppSettings["dsn"];
SqlConnection cn=new SqlConnection(strconn);
cn.Open();
SqlCommand cm=new SqlCommand("usersmodify",cn);
cm.CommandType=CommandType.StoredProcedure;
cm.Parameters.Add("@name",SqlDbType.VarChar);
cm.Parameters.Add(new SqlParameter("@upw",SqlDbType.Int));
string namevalue=e.Item.Cells[1].Text.ToString();
cm.Parameters["@name"].value=namevalue;
string upwvalue=((DropDownList)e.Item.FindControl("ddl_upw"
).SelectedItem.value.ToString();
// string upwvalue=((DropDownList)e.Item.Cells[2].Controls[0]).SelectedItem.value.ToString();
// string upwvalue=e.Item.Cells[2].Text;
cm.Parameters["@upw"].value=Convert.ToInt16("upwvalue"
;
cm.ExecuteNonQuery();
DataGrid1.EditItemIndex=-1;
BindGrid();
更新时发生错误!
是不是datagrid控件运用出现错误?