Saturday, February 25, 2012

Question on connection to SQL Server using windows authentication

I have a domain user account through which I can log on a machine. The machine allows me to use this domain user account to create DB in SQL Server using windows authentication. How can I define a connection string to connect SQL Server? My connection string is like:
string str = "server=(local);uid='"+userName+"';password='"+password+"';database='master';connection timeout=15";

This one works on another machine where I use SA account. But this one does not work using windows authentication. I tried to use domainname\myname as user name, but failed.
Could any one give me some suggestion?I solved the problem.|||Hi bagofbones.

I have the same problem.

Please post your solution.

Thanks.

DS

No comments:

Post a Comment