ashton83
New member
- Joined
- Jan 23, 2018
- Messages
- 1
- Programming Experience
- 3-5
Using the code below to connect to a SQL server and for half the users it connects using the user "john" from the query string and connects fine but others its using the same query string but ignores the userID and uses their windows id instead.
Has anyone else come across this and why it ignores the userID?
Thanks,
John
using (SqlConnection connection = new SqlConnection("Data Source=sqlServer;Database=dbName;User Id=john;Password=pass123;"))
{
connection.Open();
// Do work here; connection closed on following line.
connection.Close();
}
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection(v=vs.110).aspx
Has anyone else come across this and why it ignores the userID?
Thanks,
John
using (SqlConnection connection = new SqlConnection("Data Source=sqlServer;Database=dbName;User Id=john;Password=pass123;"))
{
connection.Open();
// Do work here; connection closed on following line.
connection.Close();
}
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection(v=vs.110).aspx