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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:37:05+00:00 2026-05-16T17:37:05+00:00

Using asp.net MVC in c#, I am making a call to a stored procedure

  • 0

Using asp.net MVC in c#, I am making a call to a stored procedure using Linq into my SQL Members table. I have no internal caching on the application, already checked to make sure it is turned off.

Test case:
I have my username set to test1. From the website I change my username to test2. The website still shows test1. I go to Management Studio and run my stored procedure called MemberByEmail, it shows test2 correctly.

I start simple, refresh my page to see if it’s browser cache, still test1. I go to debugging and walk through the code and find that it goes correctly all the way to here to call the database:

/// <summary>Method that is mapped to the dbo.MemberByEmail database procedure.</summary>
    /// <returns></returns>
    [System.Data.Linq.Mapping.Function(Name="dbo.MemberByEmail")]
    public System.Data.Linq.ISingleResult<BookCrossing.Data.Member> MemberByEmail(
        [System.Data.Linq.Mapping.Parameter(DbType="nvarchar(100)")] string email)
    {
        var methodInfo = (System.Reflection.MethodInfo)System.Reflection.MethodInfo.GetCurrentMethod();
        var result = this.ExecuteMethodCall(this, methodInfo, email);

        return ((System.Data.Linq.ISingleResult<BookCrossing.Data.Member>)(result.ReturnValue));
    }

I turned on the profiler for my sql db, and it actually shows an entry for MemberByEmail, and the result set that came back had username = test1 .

Again I ran the stored procedure through Management Studio, and it came up with test2 as the username. I waited for 15 minutes, refreshing the web page every 5 or so, and it never cleared and served the correct test2 from the db. The last strange piece, I ran IISReset and refreshed the page, test2 was returned.

I’m guessing this I am just overlooking something obvious. Any help or advice would be great. Thanks

UPDATE: I created a console application to take out the web piece of it. The problem is the same when accessing directly from a console app also, no change.

  • 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-16T17:37:06+00:00Added an answer on May 16, 2026 at 5:37 pm

    Took a while but we got this resolved. Data access is done through a MemberRepository in our project, and we loaded member repository in our MembershipProvider class. The problem is that the MembershipProvider class was loaded at the start of the application and never removed, so all MemberRepository calls were done through the same context. The strange part is that the call went all the way to SQL (as noted we were able to see the request in profiler), but the bowels of the code got back the results set but instead used the first calls result set and sent that back to us.

    So by moving the Repository into the desired method or our MembershipProvider, it was destroyed after each call and that solved the issue. I don’t know that this is specific to our set up, but hopefully it will help someone in the future.

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

Sidebar

Related Questions

I am using asp.net MVC to develop an application that will have ajax interactions.
I've been developing a site using ASP.NET MVC, and have decided to use the
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
I'm using ASP.NET MVC Preview 4 and would like to know how to use
If you are using ASP.NET MVC how are you doing grid display? Rolled your
I am using asp.net mvc for an application. I've taken some guidance from Rob
I'm using ASP.NET MVC Framwork and trying to grok the ASP Membership 3.5 stuff.
I know this site is written using ASP.Net MVC and I do not see
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually

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.