解决方法:
修改连接字符串“Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|mydb.mdf;Integrated Security=True;User Instance=False"