| |

VerySource

 Forgot password?
 Register
Search
View: 745|Reply: 5

Question about timeout. (Database connection timed out)

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-19 10:30:02
| Show all posts |Read mode
Sometimes you have to insert N records and then the database connection times out.
Because the end of the code needs to turn the inserted record into an Excel file for download by the client, once the timeout occurs, some single encrypted information will be lost (such as md5 encrypted password), so it takes time and effort to update the password.
How can I handle this situation? Can C # catch SQL database timeout errors? Or is there any better way? ?
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 Australia

Post time: 2020-6-25 14:15:02
| Show all posts
Set SqlConnection.ConnectionTimeout longer!
Reply

Use magic Report

0

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-25 16:30:01
| Show all posts
<add key="ConnectionString" value="Data Source=.;Initial Catalog=MiaDB;User ID=sa;Password=sa;Max Pool Size=300;Connect Timeout=20" />
Reply

Use magic Report

0

Threads

8

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-1 12:30:01
| Show all posts
Timeout=100000000000000000000000000
Reply

Use magic Report

0

Threads

6

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-1 19:15:01
| Show all posts
Can only help you up.
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-11 16:00:01
| Show all posts
However, the plain text of the connection password appears in the web.config, which is not very secure. How to avoid it? ?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list