0

I have the following construct:

srv-mssql1

  • Windows Server 2008
  • Microsoft SQL Server
  • With a local user: dbuserNT1 (it is added unders Logins as a DB user)

srv-iisweb1

  • Windows Server 2012
  • IIS
  • ASP.Net / C# app running

I want to connect to the SQL Server with the user dbuserNT1 from srv-iisweb1 (through the ASP.Net app).

How do I have to build my connection string to achieve that?

Please note that dbuserNT1 is a local user on srv-mssql1

So I tought I'd need to use the user srv-mssql1\dbuserNT1. But that doesn't work.

Doesn't work trough ssms on my windows 7 machine, but from the srv-mssql1 also with ssms it works trough windows authentication.

When I try to connect from my Windows 7 machine, ssms throws Error: 18456

Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
MoJo
  • 93
  • 1
  • 13
  • You can use Data Source= srv-mssql1\SQLSERVERINSTANCE; Initial Catalog=DatabaseName ;User ID=dbuserNT1 ;Password=Password; – H.Mikhaeljan Aug 09 '17 at 09:31
  • @H.Mikhaeljan Thanks, that was my first guess as well. Tried it again, but I still get the error 18456. – MoJo Aug 09 '17 at 09:46
  • Maybe this can help you further. [link](https://stackoverflow.com/questions/20923015/login-to-microsoft-sql-server-error-18456). Are you only using the user to authenticate without the password? Maybe try: "Persist Security Info=False;Integrated Security=true; Initial Catalog=Databasename;Server=srv\mssql1\SQLSERVERINSTANCENAME" – H.Mikhaeljan Aug 09 '17 at 11:43
  • Thank you for the link, I have activated **SQL Server and Windows Authentication mode** No, I am using the password aswell. I've just thought about it again - it might be impossible to achieve what I want to do. I'm going with a workaround now. – MoJo Aug 09 '17 at 12:06

0 Answers0