我尝试在 c# .net 服务器端创建一个下拉列表...但这不起作用..有人知道这里出了什么问题吗?
string conncetionStr = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
SqlConnection msSQLConnectoin = new SqlConnection(conncetionStr);
SqlCommand msSQLCommand = msSQLConnectoin.CreateCommand();
msSQLCommand.CommandText = "app_Event_Type_Select";
msSQLConnectoin.Open();
SqlDataReader msDataReader = msSQLCommand.ExecuteReader();
while (msDataReader.Read())
{
dropDown.DataSource = msDataReader["Name"].ToString();
dropDown.DataTextField = msDataReader["Name"].ToString();
dropDown.DataValueField = msDataReader["EventTypeID"].ToString();
dropDown.DataBind();
}