Hi I've created a login in my SQL Server 2005 like this:
CREATE LOGIN testuser
WITH PASSWORD = 'TestPWD';
USE DB1;
CREATE USER testuser FOR LOGIN testuser;
GO
now i want to connect from a c# app with the following connection STring
"Data Source=TURM21;Initial Catalog= Db1; Database= Db1 ; USER = testuser; PASSWORD = TestPWD; pooling=false; "
and i get the following Exception:
SqlConnection Handle : System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
CAn somebody help me? Whats wrong? Is it my connection string?
GreetzYou should use GRANT statement to grant to this user privillege use the DB1 before use that username to login to DB|||have granted access to user manually in DB.
Changed the Conn String an d now it works:
"Data Source=TURM21; Database= Db1 ; USER id= testuser; PASSWORD = testPWD; Trusted_Connection=True ";
Set the Trusted_Connection to true
Monday, March 26, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment