TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Eslam Amgad
NA
1
0
SQLCommand Timeout expired
Aug 3 2010 4:24 AM
Dear Helpers,
I Have a strange problem with this code:
string myConstr="Data Source=.;Initial Catalog=Corp;Integrated Security=True";
SqlCommand updCmd = new SqlCommand();
updCmd.CommandText = "UPDATE .....";
using (updCmd.Connection = new SqlConnection(myConstr))
{
updCmd.Connection.Open();
//myCon2.Open();
try
{
GC.Collect();
int dr = updCmd.ExecuteNonQuery();
GC.Collect();
}
catch
{
}
updCmd.Connection.Close();
updCmd.Connection.Dispose();
}
This UPDATE command takes 1 sec. from my microsoft sql server management studio query.
This code block is in a loop.
This UPDATE command "ExecuteNonQuery()" is ok for about the first 20 loop and then throws this exception:
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
Reply
Answers (
1
)
how to get ext. of a selected file ?
Dynamic TemplateField