There is a database, in the C # console application I try to fetch the database and read the contents of the table as follows:
string cs= @"Data Source=.\SQLEXPRESS;Initial Catalog=ShopDB;Integrated Security=True;"; string command = "SELECT * FROM Customers"; DataTable customers = new DataTable(); using (SqlConnection connection = new SqlConnection(cs)) { connection.Open(); SqlCommand cmd = new SqlCommand(command, connection); SqlDataReader dr = cmd.ExecuteReader(); customers.Load(dr); dr.Close(); } When I try to open a connection, I get an error
System.Data.SqlClient.SqlException: 'Cannot open database "ShopDB" requested by the login. The login failed. Login failed for user 'MicrosoftAccount\mail@yahoo.com'.' I use MS SQL Server Express 2016 DB, Windows 10, VS 2017. In the DB, Authentication method is selected by Windows Authentication. When you try to specify in the connection string the user name, which is displayed when connecting to the database (in the inactive fields) and the password that corresponds to this user, an error appears
System.Data.SqlClient.SqlException: 'Login failed for user 'DESCTOP-5HGPGMV\username'.' Tell me, please, what is the error.
