62,271
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
//数据绑定的方法
AbilityDB_Drop();
}
protected void But_EvalPradd_Click(object sender, EventArgs e)
{
EvaluationVariable Add = new EvaluationVariable();
Add.title = this.Box_EvalPrBT.Text.Trim();
//这里获取值
Add.classid = this.Drop_EvalClassid.SelectedValue.ToString();
}
public void AbilityDB_Drop()
{
string sql="select * from TEST";
try
{
SqlConnection conn = new SqlConnection(SqlServerHelper.EvaluationDB.ConnectionStringLocalTransaction);
conn.Open();
SqlDataAdapter dr = SqlServerHelper.EvaluationDB.Executeadp(conn, sql, null);
DataSet ds = new DataSet();
dr.Fill(ds);
DataTable dt = new DataTable();
dt = ds.Tables[0];
Drop_EvalClassid.DataSource = dt.DefaultView;
Drop_EvalClassid.DataTextField = "Name";
Drop_EvalClassid.DataValueField = "Id";
Drop_EvalClassid.DataBind();
conn.Close();
}
catch (Exception ex)
{
//错误;
}
}