I am changing a C#.net 2008 application to pass user credtional information to sql server 2008 by using windows authenication instead of sql server authenication. To pass this information to sql server, can I use the following statement:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
If not, do I need to pass the individual user's name ans password to sql server? How would you complete this task in C#.net?
Loading
Guest UserPosted Aug 26, 2011, 11:21 AM
Windows knows who the user is (since they had to login to Windows to get to your app), and that's the username that will be passed automatically to SQL Server. However, that means SQL Server will need to know who that person is -- i.e. there will need to be a SQL login for each user (or group of users) of your application.
You don't need to do anything different in C# to establish the db connection, as your connection string looks correct.