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 3991156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:34:53+00:00 2026-05-20T06:34:53+00:00

Website using .NET Framework v3.5, SQL Server 2008, written in C# I have a

  • 0

Website using .NET Framework v3.5, SQL Server 2008, written in C#

I have a stored procedure which I have added to my DBML by dragging it across from the server explorer.
In it’s properties it returns Auto-generated type.
The procedure takes < 1 second to run from within SQL Mgmt Studio for all inputs.
However from the code for 1 particular input (which takes < 1 second in the Mgmt studio) it hangs and then throws:

System.Data.SqlClient.SqlException: Timeout expired.

This didn’t always happen for this one input! It used to also work fine when called from the code. The last time it didn’t work I deleted and re-added the same stored procedure to the DBML. This “fixed” it, and that input ran fine and in the same time as all the others. However this is not an adequate fix! It has happened again and I can’t keep deleting and re-adding as required.
I made no changes to the data that’s being returned during the point at which it was “fixed”, so I can’t think what the problem could be. Any help on this would be much appreciated!

  • 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-20T06:34:54+00:00Added an answer on May 20, 2026 at 6:34 am

    It turns out that this is parameter sniffing – this is explained in another post: Executing stored proc from DotNet takes very long but in SSMS it is immediate

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

Sidebar

Related Questions

I'm developing ASP.NET 4.0 Website using SQL server 2008 with Membership Framework. It runs
The setup: (using Asp.Net MVC 2 RC, Entity Framework, SQL Server, VS2008) My buddy
I have an ASP.Net 2.0 web site, using the DotNetNuke framework (4.09), and it
I have a website built using Asp.net and LinqToSql for Data Access. In a
We have a website running .NET 2.0 and have started using the ASP.Net HttpRuntime.Cache
I am looking to build a new website which will require a sql server
I'm about to begin building a website using the ASP.NET MVC framework and I'm
I have an IIS 6.0-based C#/ASP.NET web site with a SQL server backend. I
Im currently making a very simple WebApp on a Website using ASP.NET Framework using
I'm developing a website (using asp.net by the way) and I'm having a problem

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.