Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 3.5 and Visual Studio. 2008 > .NET Framework 3.5
|
.NET Framework 3.5 For discussion of the Microsoft .NET Framework 3.5.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 3.5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2010, 06:55 AM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to karveajit
Smile Changing the default value of SQLCommand.CommandTimeOut property

People,

The default value for SQLCommand.CommandTimeout is 30 seconds. I want to change this value globally so that whever I create an object of SQLCommand object, it will have the value which I've set. Can anyone suggest a way out?

Thanks,
Ajit
 
Old April 7th, 2010, 07:45 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well the easiest way is to have a factory method that creates a SQLCommand, and then you can set whatever you want in there.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old April 7th, 2010, 08:22 AM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to karveajit
Default

It's a good solution while doing new development. In my case, I've the application already written and people have used the default timeout value. Now, I want a mechanism by which, if I increase the default value itself, it will reflect at all the used locations in my application.
 
Old April 7th, 2010, 08:38 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Computer says no...

http://stackoverflow.com/questions/1...her-than-recom
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing default icon on forms Dunorcaille BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 7 November 4th, 2011 08:35 AM
Default Property Value Apocolypse2005 Visual Basic 2008 Essentials 0 September 4th, 2009 03:16 PM
changing property doesn't work Vanni VB.NET 4 July 1st, 2005 07:50 AM
Problem when changing the Location property armandoa Crystal Reports 0 October 8th, 2004 06:21 PM
Changing Control Property from another Frame Wandha ASP.NET 1.0 and 1.1 Basics 4 August 8th, 2003 01:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.