Is it possible to specify commandTimeout in connection string in app.config?
According to this SO question: Entity Framework with MySQL - Timeout Expired while Generating Model the following should work:
<add name="DataEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=XXXX;initial catalog=XXXXX2;persist security info=True;user id=XXXXX;password=XXXXX;multipleactiveresultsets=True;App=EntityFramework;Default Command Timeout=12;"" providerName="System.Data.EntityClient" />
However, it does not work - exception is thrown saying that Default Command Timeout
is not known part of connection string.
If I do this directly in code using the following code, it works fine:
var db = new DataEntities(); // ObjectContext
db.CommandTimeout = 1;
Does anybody know how to set the commandTimeout using connectionstring or other native option in config?
Thank you.