public static ICollection<string> ListUserDatabases(string servername,string username,string password)
 {
     var connection = new SQLDatabaseConnection(servername,username,password,"master");
     var res = new List<string>();
     using(var conn = connection.GetConnection()) {
         conn.Open();
         var cmd = conn.CreateCommand();
         cmd.CommandText = " select * from sys.databases";
         using(var reader = cmd.ExecuteReader()) {
             while(reader.Read()) {
                 var name = (string)reader["name"];
                 if(name=="master") {
                     continue;
                 }
                 res.Add(name);
             }
             return res;
         }
     }
 }
        public static ICollection <string> ListUserDatabases(string servername, string username, string password)
        {
            var connection = new SQLDatabaseConnection(servername, username, password, "master");
            var res        = new List <string>();

            using (var conn = connection.GetConnection()) {
                conn.Open();
                var cmd = conn.CreateCommand();
                cmd.CommandText = " select * from sys.databases";
                using (var reader = cmd.ExecuteReader()) {
                    while (reader.Read())
                    {
                        var name = (string)reader["name"];
                        if (name == "master")
                        {
                            continue;
                        }
                        res.Add(name);
                    }
                    return(res);
                }
            }
        }
		public V11ServerUsagesClient(SQLDatabaseConnection connection) {
			_connection = connection;
		}
 public SysResourceStatsUsagesClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }
 public static string NormalizeServername(string servername)
 {
     return(SQLDatabaseConnection.NormalizeServername(servername));
 }
 SQLDatabaseUsageClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }
Exemplo n.º 7
0
 public V11ServerUsagesClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }
		SQLDatabaseUsageClient(SQLDatabaseConnection connection) {
			_connection = connection;
		}
 public SysResourceStatsUsagesClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }
Exemplo n.º 10
0
 internal SQLDatabaseStatsClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }
 internal SQLDatabaseStatsClient(SQLDatabaseConnection connection)
 {
     _connection = connection;
 }