I have a combobox that I would like to use to select the database from a selection available to the user. I have found plenty of information on populating the fields with table values but nothing on making a selection on which .dbo they can use. I'm guessing the same principle can be used as below...
but I would presume that (database =) needs to be taken out and replaced some how.
any advice would be appreciated
var connectionString = "server = (local); database = database; integrated security = true;"
string Sql = "select database...";
SqlConnection _con = new SqlConnection(connectionString);
_con.Open();
SqlCommand cmd = new SqlCommand(Sql, conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
combobox1.Items.Add(reader[0]);
}