vs2019连接SQL2017时提示“用户sa登陆失败”?

private void button1_Click(object sender, EventArgs e)
{

        string username = textBoxUserName.Text.Trim();  //取出账号
        string password = EncryptWithMD5(textBoxPassWord.Text.Trim());  //取出密码并加密

        FormMainUser.sno = textBox1.Text.Trim();
        //FormCourseUser.Sno = textBox1.Text.Trim();

        string myConnString = "Data Source=.;Initial Catalog=School;Persist Security Info=True;User ID=sa;Password=sa";


        string sql;
        if (comboBox1.Text.Equals("用户"))
        {
            sql = "select Uname,Upassword from Usertable where Uname = '" + username + "' and Upassword = '" + password + "'";
        }                                          
        else
        {
            sql = "select Mid,Mpassword from Managetable where Mname = '" + username + "' and Mpassword = '" + password + "'";
        }
        SqlConnection sqlConnection = new SqlConnection(myConnString);  //实例化连接对象
        sqlConnection.Open();
        SqlCommand sqlCommand = new SqlCommand(sql, sqlConnection);

图片说明
想问一下应该怎么解决?账号密码都是对的。

有报错图么?通常来讲sa账户如果登陆不进去,要不是你的连接字符串大小写的问题,要不就是数据库服务没有打开。具体的还得你发个截图看看