GridViewMove.DataBind();
DropDownList myDDNewUnit = DetailsViewMove.FindControl("DropDownListNewUnit") as DropDownList;
string connectionString = ConfigurationManager.ConnectionStrings["MyDB"].ConnectionString;
SqlConnection myConnection = new SqlConnection(connectionString);
myConnection.Open();
String SQLconn = "select unitid from unit where 单位名称='" + myDDNewUnit.SelectedValue.ToString()+"'";
SqlCommand myCommand = new SqlCommand(SQLconn, myConnection);
SqlDataReader myReader = myCommand.ExecuteReader();怎么把String SQLconn = "select unitid from unit where 单位名称='" + myDDNewUnit.SelectedValue.ToString()+"'";
赋给一个变量?
DropDownList myDDNewUnit = DetailsViewMove.FindControl("DropDownListNewUnit") as DropDownList;
string connectionString = ConfigurationManager.ConnectionStrings["MyDB"].ConnectionString;
SqlConnection myConnection = new SqlConnection(connectionString);
myConnection.Open();
String SQLconn = "select unitid from unit where 单位名称='" + myDDNewUnit.SelectedValue.ToString()+"'";
SqlCommand myCommand = new SqlCommand(SQLconn, myConnection);
SqlDataReader myReader = myCommand.ExecuteReader();怎么把String SQLconn = "select unitid from unit where 单位名称='" + myDDNewUnit.SelectedValue.ToString()+"'";
赋给一个变量?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货