-
Notifications
You must be signed in to change notification settings - Fork 305
Is it possible to add keyword "Command Timeout" to the connection string #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I believe it should be possible, we'll keep that noted for future enhancements. |
For reference, Npgsql has this. |
Would you consider a community PR for this? |
@roji Can you point me to how you are prioritizing CommandTimeout set via the Connection string vs CommanTimeout set in code? |
In Npgsql, the programmatic NpgsqlCommand.CommandTimeout takes precedence over the connection string parameter - as a general rule, programmatic access always overrides connection string parameters (as they can be more specific). |
@roji Thanks! Will try the same with SqlCommand. Nice #regions 😁 |
API proposal:
SqlCommand will use same precedence logic as here |
@ErikEJ That would be great! |
I will look into it, I think it would be a very welcome addition, in particular if you are using some library on top of ADO.NET, where it may not be possible for you as a library consumer to modify the command timeout. |
Right now the only way to override default value of SqlCommand.CommandTimeout is to do this in code.
It would be nice to do this through connection string/ConnectionStringBuilder/Connection.
The text was updated successfully, but these errors were encountered: