I have a SQL Server 2008 R2 running but when I try to connect to the server via my C# connection string I receive an error. I have no clue of what the problem is!

Here is my connection string:

_msConnection = new SqlConnection("Server=ServerIpAdress;Database=DataBaseName;User Id=NetworkName\\UserName;Password=PW;");

I hope some of you guys can help me?

Have a great day you all!

有帮助吗?

解决方案

Id=NetworkName\\UserName

sounds a bit strange, try

Id=username

Also if you can connect to the DB using MS VS, MS SMS or any other likely tools your app can connect passin exactly same paramenters.

Other things to check: Actual user running the app (IIS_USR maybe) In your SMS or VS you can get the actual connection string being used and just copy past it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top