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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:47:36+00:00 2026-06-08T17:47:36+00:00

While debugging an ASP.Net MVC application running under IIS Express, I get the following

  • 0

While debugging an ASP.Net MVC application running under IIS Express, I get the following error when attempting to use the membership provider:

Cannot open database “MyDB” requested by the login. The login failed.

Login failed for user ‘MY-PC\MyName’.

I attempted to troubleshoot using the steps outlined in

https://stackoverflow.com/a/2577854/141172

SELECT SUSER_ID('MY-PC\MyName')

returns an ID.

SELECT USER_ID('MY-PC\MyName')

returns NULL

CREATE USER [MY-PC\MyName] FROM LOGIN [MY-PC\MyName]

returns the error message

The login already has an account under a different user name.

Indeed, there is a login account, automatically created when I created the database, called

dbo

which maps to MY-PC\MyName.

My connection string is

Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;Persist Security Info=True;Integrated Security=SSPI;

Running in a production environment I would know how to create appropriate users and logons. I’m stuck on how to resolve the fact that IIS Express is using my Windows account name to try and log into MyDB when that Windows account is already associated with dbo.

  • 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-06-08T17:47:38+00:00Added an answer on June 8, 2026 at 5:47 pm

    It turned out to be a typo in the Initial Catalog portion of the connection string.

    Looking in the event log, I saw an error like

    Login failed for user ‘MY-PC\MyName’. Reason: Failed to open the explicitly specified database. [CLIENT: ]

    Then looking on the details tab of the same event, I saw that the Binary Data In Bytes information contained

    0000: 18 48 00 00 0E 00 00 00   .H......
    0008: 17 00 00 00 45 00 52 00   ....E.R.
    0010: 49 00 43 00 2D 00 4F 00   I.C.-.O.
    0018: 52 00 49 00 47 00 49 00   R.I.G.I.
    0020: 4E 00 5C 00 53 00 51 00   N.\.S.Q.
    0028: 4C 00 45 00 58 00 50 00   L.E.X.P.
    0030: 52 00 45 00 53 00 53 00   R.E.S.S.
    0038: 00 00 07 00 00 00 6D 00   ......m.
    0040: 61 00 73 00 74 00 65 00   a.s.t.e.
    0048: 72 00 00 00               r...
    

    Notice how the last portion of that is UTF-16 encoded the word “master”. That got me on the track that the connection is being made to the master catalog rather than the requested one, which in turn lead to noticing the typo in the catalog name in the connection string.

    It would have been so much nicer if Microsoft would have just show an error like “No such catalog: MyCatalog”.

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

Sidebar

Related Questions

I get this problem very often while debugging a ASP.Net MVC(3) application. I found
I've been getting an error recently while debugging an ASP.NET application in Visual Studio
While debugging an ASP.NET application, I want to get a print-out of the entire
While debugging ASP.NET MVC source i found MVC-ControllerTypeCache.xml file is used. But i am
How do I display localhost traffic in Fiddler while debugging an ASP.NET application?
I need to modify source files while debugging my ASP.NET MVC app. I know
While debugging a .NET Framework 3.5, WinForms application I spotted some Worker Threads without
How to access stack frame information while debugging ASP.net program?
I now get the ASP.NET Ajax client-side framework failed to load. javascript error in
Is there a way to enable code coverage while debugging a asp.net site (+assemblies)?

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.