C# - MSSQL Random Timeouts(www.stev.org)

submitted by mistralolmistralol(283) 8 months, 25 days ago

If you have ever come across a c# application or any asp.net application for that matter that appears to work perfectly then without warning starts to fail with database timeout issues. There is one of two things normally wrong. Either it is a database problem. Or another rather common problem is actually in the code inside the application. This is when the developers and the database guys normally start screaming at each other. This normally happens because the developers cannot reproduce any problems in their enviroment and the dba's know that there database is in perfect working order and see little or no load on the sql server. This can happen if you have the following code

3 comments |category: |Views: 24

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by mistralolmistralol(283) 8 months, 24 days ago +1

Its in the connection string ...

string Args = "Data Source=SQL;Initial Catalog=Mess;Integrated Security=True;Connect Timeout=10;Timeout=10;Max Pool Size=10;"

Reply

posted by dpetersondpeterson(4397) 8 months, 24 days ago 0

I think this has less to do with SQL, and more to do with understanding exception handling in .Net better.
No code in your try block will run after the point at which the exception occurred, and putting cleanup code outside the try/catch will not work either as that code may not be reached if the exception handling throws the exception up the call stack. What needs to be used here is a finally statement, which will run whether an exception is thrown or not.

Reply

posted by vijaystvijayst(1311) 8 months, 24 days ago 0

It is interesting to read your article. I am curious to know how the maximum connections in the connection pool is configured. Thanks.

Reply

information Login or create an account to comment on this story