OleDbDataAdapter adp = new OleDbDataAdapter("select * from ad", conn);
DataSet ds = new DataSet();
adp.Fill(ds, "ad");
for (int i = 0; i < ds.Tables["ad"].Columns.Count; i++)
this.DropDownList1.Items.Add(ds.Tables["ad"].Columns[i].ColumnName);
DataTable tempTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
for (int i = 0; i < tempTable.Rows.Count; i++)
this.DropDownList2.Items.Add(tempTable.Rows[i]["TABLE_NAME"].ToString());
一个是获取表中的字段 一个是获取表 我的意思是怎么把它做到DropDownList 选择了表就在DropDownList2中获取到该表的字段..