2017-04-24 14 views
0

EFコアでNpgsqlを使用して、デモコンソールアプリケーション用のPostgreSQLへの接続を確立しています。しかし、私は例外が発生しました '初期化文字列の書式がインデックス0で始まる仕様に準拠していません'。私は接続ストリングの問題のためにこれを考えています。どんな助けもありがとうございます。Entity Frameworkコアを使用したNpgsql接続文字列

Exceptionenter image description here

enter image description here

答えて

2

これは罰金を行う必要があります。

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 
    { 
     optionsBuilder.UseNpgsql(@"Server=localhost;Port=5432;Database=dbname;User Id=Id;Password=password"); 
     base.OnConfiguring(optionsBuilder); 
    } 
関連する問題