ExecuteScalar() public method

public ExecuteScalar ( string sql, int timeout = 30, object>.IDictionary parameters = null ) : int
sql string
timeout int
parameters object>.IDictionary
return int
Exemplo n.º 1
0
 public bool Exists(string databaseName)
 {
     return
         (Convert.ToBoolean(_executeMaster.ExecuteScalar("SELECT database_id FROM sys.databases WHERE Name = @databaseName",
                                                         parameters:
                                                         new Dictionary <string, object> {
         { "@databaseName", databaseName }
     })));
 }