看文档这个方法是用Windows 验证。意味着本地机器上要有这个账户 Ctrl +R -> Enter cmd in RUN -> type 'net user'. This lists you all Windows account on your PC.In the command prompt, you can enter 'whoami'. This will list your current windows account. 你程序里是用sa。 sa是SQL的默认管理员用户名。 用的是SQL验证。 所以就不工作啦
一般connection string不是要 servername\instancename 吗?e.g. localhost\SQLExpress
你程序里是用sa。 sa是SQL的默认管理员用户名。 用的是SQL验证。 所以就不工作啦