Possible Duplicate:
SQL Server query to find all current database names
我正在try 如何在连接到服务器后列出数据库,而不先指定数据库.
sqlConnection1 = new SqlConnection("Server=" + sqlServer + ";Database=" + database +
";User ID=" + userName + ";Password=" + password + ";Trusted_Connection=False;");
因此,基本上我想要的是最终用户连接到SQL服务器,然后有一个填充了他们可以连接和查询的数据库列表的下拉列表.
pip ?