Entity Framework : “The underlying provider failed on Open”

前端 未结 6 1795
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 00:20

When I try to insert a record, I get this error : The underlying provider failed on Open. This error occurs only with IIS and not with VWD 2008\'s webserver. In the EventViewer

6条回答
  •  星月不相逢
    2021-02-13 00:46

    Using new instance of DB Entity on every action should not physically create connection to your SQL server. Entity Framework will use connection pool created for your (process, app domain, connection string) as configured in your connection string to avoid creating new connections.

    This issue is very environmental and tweaking parameters (in your conn string) like below should resolve the problem-

    Min Pool Size=1;

    Max Pool Size=100; // default

    Connect Timeout=15; // in seconds

    Pooling=true;

提交回复
热议问题