Database.Exists 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Exists() |
檢查資料庫是否存在伺服器上。 |
Exists(DbConnection) |
檢查資料庫是否存在伺服器上。 |
Exists(String) |
檢查資料庫是否存在伺服器上。 使用指定的資料庫名稱或連接字串來建立資料庫的連線,方式與 類別的檔 DbContext 中所述相同。 |
Exists()
檢查資料庫是否存在伺服器上。
public bool Exists ();
member this.Exists : unit -> bool
Public Function Exists () As Boolean
傳回
如果資料庫存在則為 true,否則為 false。
適用於
Exists(DbConnection)
檢查資料庫是否存在伺服器上。
public static bool Exists (System.Data.Common.DbConnection existingConnection);
static member Exists : System.Data.Common.DbConnection -> bool
Public Shared Function Exists (existingConnection As DbConnection) As Boolean
參數
- existingConnection
- DbConnection
與資料庫的現有連接。
傳回
如果資料庫存在則為 true,否則為 false。
適用於
Exists(String)
檢查資料庫是否存在伺服器上。 使用指定的資料庫名稱或連接字串來建立資料庫的連線,方式與 類別的檔 DbContext 中所述相同。
public static bool Exists (string nameOrConnectionString);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
public static bool Exists (string nameOrConnectionString);
static member Exists : string -> bool
Public Shared Function Exists (nameOrConnectionString As String) As Boolean
參數
- nameOrConnectionString
- String
與資料庫連接的資料庫名稱或連接字串。
傳回
如果資料庫存在則為 true,否則為 false。
- 屬性