I was trying to bring all the database names in a dropdownlist..
Here is my code ..
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
populateddl();
}
}
private void populateddl()
{
using (SqlDataAdapter sda = new SqlDataAdapter("exec sp_databases", conn))
{
using(DataSet ds = new DataSet())
{
sda.Fill(ds);
DropDownList8.DataSource = ds;
DropDownList8.DataBind();
}
}
}
em not able to get the names in the dropdownlist, pls help me in this scenario..
when run the application what em getting is..
system.data.datarowview
as items of dropdownlist instead of this i should get names of databases
Looking forward for ur replys
Thanks & Regards,
aslo specify the column name of the Datasource to be displayed