I had a similar problem a while ago. Sometimes it would connect and other times it would time out depending on which server was the current primary. I believe there is a DNS setting you can use to get around this but that was not an option in our case. The only solution I came up with was to set a long timeout (300 seconds) in the connection string. So now sometimes it connects right away and the rest of the time it will take about a minute. Not ideal but we've been able to live with it. Hope this helps.
Joe DiNatale
Posts
-
OLEDB connection to a SQL server database hosted in an availability group (repost) -
Algorithm to count how many "1" in binary o(1)Member 11055093 wrote:
I've been told I can do it using space as much as I need.
Fastest way with unlimited space would be a lookup table.
-
generate random numbers from specific arrayUsing your example, I would generate a random number between 0 and 2. Then use the result as an index to your three element array.
-
Daily Reminders in Sharepoint 2010Thanks for the suggestion. I'll try it. Joe.
-
Daily Reminders in Sharepoint 2010I have a Calendar (Event List) on my Sharepoint site and I want to send out a daily email containing a list of the next day's events (just the event titles would be fine). Can anyone point me in the right direction? I tried using a workflow but I couldn't figure out how to get multiple events in one email message. Any ideas you may have would be greatly appreciated. Joe.
-
Retrieving the new defalt value of a uniqueidentifierhenry1951 wrote:
I chose them for the absolute certainty that there would be no collisions in IDs
Actually it's not an absolute certainty. It's just that the chance of a collision is extremely small. Be careful using GUIDs as PKs. Significant performance issues can arise (both time and space are wasted) when the clustering index is a GUID and the default in SQLServer is to create a clustering index on the PK. You can get around this by using the newsequentialid()function or by generating your own sequential GUIDs. See this article[^]for a discussion of the issue.
-
FXCOP CLSCompliantMy understanding is that you should mark the attribute if you intend it to be CLS compliant and then compiler will let you know if it isn't. Look here for more info. -Joe.
-
Database transaction boundaries in three tierI would just overload the insert() method so that, if you pass in a transaction object, it uses it.
-
Pattern for Shared Dropdown TablesI just did something like this for my current project. I created a class with a shared (static) dictionary which contains the dropdown lists. There is also a shared method which is passed the name of the desired list. The method checks the dictionary first and then queries the database if necessary. It's really just a simple data caching class. Not sure if this is considered the "proper" way to do things (I'll leave that to the programming gurus out there) but it's easy to code and it reduces the number of database calls.. Hope this helps, Joe DiNatale
-
MessageBox stuck in loopPerfect! That did the trick. Thank you very much, Joe
-
MessageBox stuck in loopI have a search dialog form with a text box where the user enters the search terms and a button which executes the search. The text box traps the keyup event so that the user can just press enter and initiate the search instead of clicking on the button. When the search does not return any results, a message box pops up informing the user. The problem is that if the user clears the message box by pressing enter instead of clicking the OK button, the text box gets the keyup event again, performs the search again, puts up the message box... I was able to avoid this by disabling the textbox before showing the message box and then reenabling it after but this moves the focus to the next control. Moving the focus back to the text box (in code) causes the same behavior. Does anyone know of another way to fix this? Joe
-
Difference between INNER JOIN and WHERE ClauseNo real difference. You can express your inner joins in the WHERE clause if you wish (I believe in the early versions of SQL you had to), but your code will be easier to understand if you separate join conditions from the other conditions.