Initial commit

This commit is contained in:
2021-08-26 20:59:17 +02:00
commit 3afa4c82ef
524 changed files with 52428 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Sql;
namespace OpenDBDiff.Schema.SQLServer.Generates.Front.Util
{
internal static class SqlServerList
{
public static List<string> Get()
{
SqlDataSourceEnumerator sqlSource = SqlDataSourceEnumerator.Instance;
DataTable dt = sqlSource.GetDataSources();
List<string> serverList = new List<string>();
string serverName = null;
string instanceName = null;
foreach (DataRow dr in dt.Rows)
{
serverName = dr["ServerName"].ToString();
instanceName = dr["InstanceName"] != null ? dr["InstanceName"].ToString() : null;
if (string.IsNullOrEmpty(instanceName))
serverList.Add(serverName);
else
serverList.Add(string.Format("{0}\\{1}", serverName, instanceName));
}
return serverList;
}
}
}