次の方法で共有


DbProviderServices.CreateDatabase メソッド

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

接続で示されるデータベースを作成し、storeItemCollection の内容に基づくスキーマ オブジェクト (テーブル、主キー、外部キー) を作成します。

名前空間:  System.Data.Entity.Core.Common
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

'宣言
Public Sub CreateDatabase ( _
    connection As DbConnection, _
    commandTimeout As Nullable(Of Integer), _
    storeItemCollection As StoreItemCollection _
)
'使用
Dim instance As DbProviderServices 
Dim connection As DbConnection 
Dim commandTimeout As Nullable(Of Integer)
Dim storeItemCollection As StoreItemCollection

instance.CreateDatabase(connection, commandTimeout, _
    storeItemCollection)
public void CreateDatabase(
    DbConnection connection,
    Nullable<int> commandTimeout,
    StoreItemCollection storeItemCollection
)
public:
void CreateDatabase(
    DbConnection^ connection, 
    Nullable<int> commandTimeout, 
    StoreItemCollection^ storeItemCollection
)
member CreateDatabase : 
        connection:DbConnection * 
        commandTimeout:Nullable<int> * 
        storeItemCollection:StoreItemCollection -> unit
public function CreateDatabase(
    connection : DbConnection, 
    commandTimeout : Nullable<int>, 
    storeItemCollection : StoreItemCollection
)

パラメーター

  • connection
    型 : System.Data.Common.DbConnection
    作成して、storeItemCollection パラメーターで示されるストア オブジェクトを設定する必要がある、存在しないデータベースへの接続。
  • commandTimeout
    型 : System.Nullable<Int32>
    データベースの作成に必要なすべてのコマンドの実行タイムアウト。

参照

参照

DbProviderServices クラス

System.Data.Entity.Core.Common 名前空間