|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting Command Timeout globally in Asp.Net / windows applications...Hi,
I've been tasked with the following: We need to add elements to app.config and web.config to be able to specify the CommandTimeout for SQL Commands. Since there is no option in the connection string to set this property globally, this means that every time we execute an SQL command we will need to set the CommandTimeout property on the object. It might be worth looking at implementing a ServiceRegistry to replace the current multiple places where we allocate connections. Any help on this issue would be greatly appreciated. Can't you create a global method that returns properly initialized command?
-- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ <tom.h***@gmail.com> wrote in message news:1170123039.591165.287840@l53g2000cwa.googlegroups.com... > Hi, > > I've been tasked with the following: > > We need to add elements to app.config and web.config to be able to > specify the CommandTimeout for SQL Commands. Since there is no option > in the connection string to set this property globally, this means > that every time we execute an SQL command we will need to set the > CommandTimeout property on the object. > > It might be worth looking at implementing a ServiceRegistry to replace > the current multiple places where we allocate connections. > > > Any help on this issue would be greatly appreciated. >
Show quote
On Jan 30, 3:45 am, "Miha Markic [MVP C#]" <miha at rthand com> wrote: Hi,> Can't you create a global method that returns properly initialized command? > > -- > Miha Markic [MVP C#, INETA Country Leader for Slovenia] > RightHand .NET consulting & developmentwww.rthand.com > Blog:http://cs.rthand.com/blogs/blog_with_righthand/ > > <tom.h***@gmail.com> wrote in message > > news:1170123039.591165.287840@l53g2000cwa.googlegroups.com... > > > > > Hi, > > > I've been tasked with the following: > > > We need to add elements to app.config and web.config to be able to > > specify the CommandTimeout for SQL Commands. Since there is no option > > in the connection string to set this property globally, this means > > that every time we execute an SQL command we will need to set the > > CommandTimeout property on the object. > > > It might be worth looking at implementing a ServiceRegistry to replace > > the current multiple places where we allocate connections. > > > Any help on this issue would be greatly appreciated.- Hide quoted text - > > - Show quoted text - That would be the ticket, but I don't know how to do it. Can you please supply a bit of sample code? It would be MUCH appreciated. Thanks. |
|||||||||||||||||||||||