| Author: Sandeep Chougule 30 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
Hi check this All database name inserted into combo Same this u can add names in Array list
cmm = new SqlCommand(); cmm.Connection = con; cmm.CommandType = CommandType.Text; cmm.CommandText = " select name from sys.databases"; SqlDataAdapter da = new SqlDataAdapter(cmm); DataTable dt = new DataTable(); da.Fill(dt); DataView dv=new DataView(dt); cmbDatabase.DataSource = dv; cmbDatabase.DataTextField = "name"; cmbDatabase.DataBind(); con.Close();
|