我需要在此代码中使用动态'变量'名称。你能救我吗?
像这样的“Html对象id.ToString();”
public static void ddl(string sorgu,object ad)
{
using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["vtbag"].ConnectionString))
{
cnn.Open();
using (SqlCommand cmd = new SqlCommand(sorgu, cnn))
{
using(SqlDataAdapter bakadp = new SqlDataAdapter(sorgu, cnn))
{
using (DataTable baktbl = new DataTable())
{// Here is my problem
bakadp.Fill(baktbl);
html object id.DataSource = baktbl;
html object id.DataTextField = "ad";
html object id.DataValueField = "id";
html object id.DataBind();
}// End
}
}
}