Hi, I am using an asp.net web application in which I want to retrevie database table names into my dropdown list box. I have wrote code for this there are no errors but I dont get any table name to my DDL box. Kindly help, Thank you.
MySqlConnection connect = new MySqlConnection();
connect.ConnectionString = "Data source=localhost;Database=locations;user id=root;password=ietmdb;";
connect.Open();
MySqlCommand cmd = new MySqlCommand("show tables", connect);
MySqlDataReader dr = cmd.ExecuteReader();
//MySqlDataAdapter da = new MySqlDataAdapter("show tables", connect);
//DataSet ds = new DataSet();
//ds.Fill(ds, "tables");
//DataSet ds = new DataSet();
while (dr.Read())
{
DropDownList1.Items.Add(dr["tables"].ToString());
}
//cmd.Parameters.Add(.MySqlDbType.VarChar) = DropDownList1.Text;