I am using in built sql server 2005 which comes with visual studio 2008 in my project.
This is my connection string.
SQLConnection oConnection = new SQLConnection("Data Source=.\SQLExpress Initial Catalog=Fas");
When I try to open the connection like oConnection.open() I am getting error like “Login failed for this user. User is not associated with trusted connection.”
By some googling I get the idea that I am using Windows authentication mode. So how can I change it to mix mode authentication? I dont have separate sqlserver installed on my system.
It is same that comes with visual studio 2008
It is a “Separate SQL Server”, Visual Studio just installs it for you. There is no difference between it and the SQL Express installation you would get from Microsoft.com.
You’ll want to fire up SQL Express Management Studio. It should be under “Microsoft SQL Server 2005” in your start menu. Connect to the SQLEXPRESS instance; once connected, under “Object Explorer”, right click the server itself, hit properties, then Security.
Using Mixed Mode isn’t the best for security practices since it requires storing a username and password in a connection string somewhere. If you are using a web server project, your best bet would be to add the
NETWORK SERVICEas a data reader / writer, or db_owner depending on your needs.