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

  • SEARCH
  • Home
  • 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 7543935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:33:26+00:00 2026-05-30T08:33:26+00:00

Step 1) I check that i can acess server: (because i have offline handling

  • 0

Step 1)
I check that i can acess server:
(because i have offline handling to)

public static bool dbOnline(string timeOut="3")
{
  bool online = false;
       try
       {
           var testConn = new SqlConnection(Utils.ConnectionStr(timeOut)); 
           testConn.Open();
           online = true;
           testConn.Close();
       }
       catch (Exception)
       {
           online = false;
       }
       return online;
   }

2) It returns ok, then i Create dlinq instance !

_DataContext = new DataContext(Utils.ConnectionStr);//System.Data.Linq.DataContext
//then i point out a customer in DB

var customer = _DataContext.Customers.TableQuery().FirstOrDefault(c => c.ID == custid);

//Check its not null
if (customer != null)
{
            customer.points+= _points;
            customer.LastUpdated = DateTime.Now;
            customer.SubmitChanges();
}

3) And sometimes i get this error, is it anything i can do to prevent this, or is it to
fix the network? (i know there is some trouble with the network), but can i do anything
different? – Thanks

Error:
*System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.*

The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
   at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
   at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
   at System.Data.Linq.ChangeDirector.StandardChangeDirector.DynamicUpdate(TrackedObject item)
   at System.Data.Linq.ChangeDirector.StandardChangeDirector.Update(TrackedObject item)
   at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
   at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
  • 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-30T08:33:28+00:00Added an answer on May 30, 2026 at 8:33 am

    A timeout is impossible to identify in isolation, however I would usually expect a network error to have a different error. The things I’d look at first:

    • is the data indexed correctly
    • was there blocking at the time, most likely by a long-running transaction that has a lock on the data
    • was there anything like a db grow happening at the time
    • was the server exceptionally busy at the time

    My money would be on the second

    Also, we can’t see what TableQuery() is; if that returns IEnumerable<Customer>, then it could be related to pulling too much data (in your context, it should probably be returning IQueryable<Customer> at the minumum, but we can’t see).

    The real thing to do here is to run a SQL trace and try to catch it in the act – see what was happening.

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

Sidebar

Related Questions

I have a multi-step BackgroundWorker process. I use a marquee progress bar because several
I have a web form with about 15 checkboxes that users may check 0
I have a step definition in my cucumber test suite that authenticates the user
So I have a multi-step process that allows a user to retrieve a forgotten
Is there any way to check step by step what's going on in let's
I have completed every step in XMonad's tutorial for Mac. However, I cannot start
I have a step in my application where a user repeatedly hears three spoken
If I step through the following code the call to ReturnOne() is skipped. static
I have written a function that checks if to files are duplicates or not.
I have this problem in my application: Step 1 - create an file (xml)

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.