In order to use integrated security, the client and the SQL Server must be on machines with a trust relationship with one another. In other words, they must be on the same domain. If this is on your home network, you will need a domain controller.
If you don't have a domain, and your requirement is to have the calling code running on a different machine from the server, then you must use SQL authentication. I believe the default when you install SQL server is for SQL authentication to be disabled, so you may need to change the authentication mode for the SQL server before you can do that. On Dec 4, 4:47 pm, henry <[email protected]> wrote: > My code can connect my db with following connection string on the same > PC of SQL 2008 R2 DB: > > Data Source=XYZ\SQLSERVER;Initial Catalog=my_db;Integrated > Security=True;uid=user;pwduserpassword; > > But when I use the same connection string to login to the db from > another PC, I failed. If I take ";Integrated Security=True" out, I got > login error. > > How to fix this? > > -Henry
