Back to list
Views:   8.9K
Replies:  2
Archived

How to use a timeout with SQL database connections.

1. How to use timeout in sql connection / sql data access

2. How to use timeout in method A call method B sync?

3. How to use timeout in method A call method B Async?

Zhang Zhao, Dec 24, 2012
Reply 1

you don't need to change the data access.

You can modify your connection string to include a timeout value:

"Data Source=144681;Initial Catalog=Customer;Timeout=60;Persist Security Info=True;User ID=xxxxx;Password=yyyyy"

Set this connection string in Hosting layout->Web.config file:

<connectionStrings>
     <add name="ADO.NET.SqlServer" connectionString=" [your connection string with timeout ] "/>
</connectionStrings>

I'm not sure what is your mean of 2 & 3 but i guess BeginExecute and EndExecute Methods in SqlCommand object can help you.


Mohammad Reza Khahani, Jan 05, 2013
Reply 2
Everyone, who can help me? especially the question 2 & 3.
Zhang Zhao, Dec 25, 2012


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas