Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 371095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:04:54+00:00 2026-05-12T14:04:54+00:00

I am using ADO.Net + C# + VSTS 2008 + ADO.Net to connect to

  • 0

I am using ADO.Net + C# + VSTS 2008 + ADO.Net to connect to SQL Server 2008 Enterprise. I am using almost the same pattern/sample mentioned here — using ADO.Net DataReader to retrieve data one entry (row) by one entry (row).

http://msdn.microsoft.com/en-us/library/haa3afyz.aspx

My question is, if I set the SqlCommand timeout in this sample,
1. I think the timeout applies to how much time we could use as maximum value to retrieve one specifc row, not the total timeout for the whole data entry-by-entry loop?

BTW: loop I mean,

while (reader.Read())
{
    Console.WriteLine("{0}\t{1}", reader.GetInt32(0),
        reader.GetString(1));
}

2.
and this timeout only matters how much time it takes to retrieve data entry from database, and this timeout has nothing to do with how much time we deal with each entry (e.g. if we set timeout to 20 seconds, and if it takes 1 second to retrieve one data entry from database, and it takes 30 seconds for my application logics to manipulate the data entry, timeout will never happen).

Correct understanding?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:04:54+00:00Added an answer on May 12, 2026 at 2:04 pm

    The command timeout that you can set applies to how long you give ADO.NET to do its job.

    If you call cmdQuery.ExecuteNonQuery() which returns nothing but performs a SQL statement it’s the time needed to perform that statement.

    If you call cmdQuery.ExecuteReader() which returns a data reader, it’s the time needed for ADO.NET to ste up / construct that data reader so that you can then use it.

    If you call cmdQuery.ExecuteScalar() which returns a single scalar value, it’s the time needed to execute the query and grab that single result.

    If you use the dataAdapter.Fill() to fill a data table or data set, it’s the time needed for ADO.NET to retrieve the data and then fill the data table or data set.

    So overall : the timeout applies to the portion of the job that ADO.NET can do – execute the statement, fill a data set, return a scalar value.

    Of course it does NOT apply to the time it takes YOU to iterate through the results (in case of a data reader). That wouldn’t make sense at all…

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a web application using SQL Server 2005, asp.net, and ado.net.
I'm looking at using ADO.NET Data Services with silverlight. I've been looking at the
I'm using ADO.NET dataservices in a Silverlight application and since the silverlight libraries don't
I'm using ADO.NET EF in an MVC application. I'm considering putting the ObjectContext inside
I have some existing code that retrieves data from a database using ADO.NET that
How can I create a empty .mdb file? I'm using ADO.NET and C#. Thanks!
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My
ADO.NET has the notorious DataRow class which you cannot instantiate using new. This is
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop,
I have a ASP.Net page using ADO to query MS access database and as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.