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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:35:30+00:00 2026-06-17T08:35:30+00:00

Im getting login failed error when trying to connect to my database using NHibernate:

  • 0

Im getting login failed error when trying to connect to my database using NHibernate:

var config = Fluently.Configure()
              .Database(MsSqlConfiguration
              .MsSql2005
              .ConnectionString("Data Source=SERVER1\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=xxx"))
              .Mappings(x => x.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));

With Error 18456 State 5 in the log viewer in SQL Management Studio.

But using sqlcmd or Management Studio it works fine (using Windows Auth)!

What could be the problem?

EDIT
The NHibernate exception:

Test method ProjektLogg.Tests.NHibernateTests.ShouldBeAbleToGenerateFactory threw exception: 
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

 ---> NHibernate.HibernateException: Login failed for user XXX-INTRANET\username. ---> System.Data.SqlClient.SqlException: Login failed for user XXX-INTRANET\username.
  • 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-17T08:35:30+00:00Added an answer on June 17, 2026 at 8:35 am

    That error message means “Invalid UserID”. If you’re running IIS, make sure your application pool uses the same identity as the user who you are connecting to the database with in management studio.

    If you’re not running under IIS, make sure your current user account (Windows) can access the database, as you’re using Integrated Security.

    Link on the error: http://blogs.msdn.com/b/sql_protocols/archive/2006/02/21/536201.aspx

    EDIT: Hang on, you’re missing Initial Catalog. Try this:

    "Data Source=SERVER1\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=YourDatabase"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting a NO LOGIN failed message when trying to connect to the
I keep getting 401 when trying to login via Oauth with Twitter. I'm using
I keep getting the following error when trying to run a login script I
The error I am getting is Cannot open database NerdlyDB requested by the login.
I am trying to connect the sql server database using 'sa' from my .Net
I am having difficulty getting rid if the following error: bash-3.00$ p4 login Enter
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':
I am getting following error each time I tried to select database. The database
I am trying to figure why I am getting this error. **Warning: require_once(\C\wamp\www\PHP with
I am trying to work on getting better at making HTML forms using PHP

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.