📜  在数据表 C# 中动态创建下拉列表 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:51.389000             🧑  作者: Mango

代码示例1
DataTable dtt1 = (DataTable)Session["dbasecolumns"];
int l = dtt1.Columns.Count;
string[] sqlcolumn = new string[l];
DropDownList drd = new DropDownList();
foreach (String colname in sqlcolumn)
{
    drd.Items.Add(colname);
}