我已经看过所有其他帖子,似乎帮不了我。
String constr = (@"Data Source=(localdb)\MSSQLLocalDB;
AttachDbFilename= E:\Downloads Mainframe\Compressed\Main Menu\HRDAssets.mdf;
initial catalog=HRDAssets;
Integrated Security=True;");
https://cdn.discordapp.com/attachments/268002637905920001/506753130848059394/unknown.png
当我删除
AttachDbFilename= E:\Downloads Mainframe\Compressed\Main Menu\HRDAssets.mdf;
出现新问题
https://cdn.discordapp.com/attachments/506763196225421312/506763211492556800/unknown.png
答案 0 :(得分:0)
从连接字符串中删除此行
AttachDbFilename= E:\Downloads Mainframe\Compressed\Main Menu\HRDAssets.mdf;
和初始目录属性,我建议使用:
Data Source=(LocalDb)\MSSQLLocalDB;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\HRDAssets.mdf