something

public static List<string> GetSqlServerNames()
{
List<string> serverNames = new List<string>();
DataTable table = SqlClientFactory.Instance.CreateDataSourceEnumerator().GetDataSources();
foreach (DataRow dr in table.Rows)
{
string serverName = string.Format("{0}\\{1}", dr["ServerName"], dr["InstanceName"]);
serverNames.Add(serverName);
}
return serverNames;
}

分类:

技术点:

相关文章:

  • 2021-11-26
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案