Home All Groups Group Topic Archive Search About

Setting Command Timeout globally in Asp.Net / windows applications...

Author
30 Jan 2007 2:10 AM
tom.herz
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.

Author
30 Jan 2007 8:45 AM
Miha Markic [MVP C#]
Can't you create a global method that returns properly initialized command?

--
Miha 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
Show quote
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.
>
Author
5 Feb 2007 6:58 PM
tom.herz
Show quote
On Jan 30, 3:45 am, "Miha Markic [MVP C#]" <miha at rthand com> wrote:
> 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 -

Hi,

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.

AddThis Social Bookmark Button