I've already seen some similar question but none of them has received a valid solution.
I've an asp.net web site which reference a dll with some method in order to execute a simple operation on database (CRUD operations). When I need to do some "select * from" I call a method of dll passing it the connection string, but any operation fails with error message like this: System.Data.SqlClient.SqlException: Login failed for user 'DOMAIN\MACHINENAME$'.
It's imposibile whereas my connection is right (user id=sa; password=password) and it is the same connection stirng that I use for all my web site. Idon't use integrated security=true, I'm just using sa account with password.
THE ONLY different between all my web site and this project is just that CRUD operation come from different assembly (my dll).
The code is very simple:
// Asp.Net Button Click
MyDll.MyClass DbClass = new MyDll.MyClass();
DbClass.ConnectionString = "Data Source=Source;Integrated Security=false;initial Catalog=NorthWind;user id=sa;password=password;Persist Security Info=true";
DbClass.ExecuteQuery(select * from tableName);
// ExecuteQuery method do other stuff as SqlDataAdapter sda = new....sda.Fill(myDataset)..
..Any ideas?