[英]Cannot attach the file as database
I've already seen all other post and seems cant help me. 我已经看过所有其他帖子,似乎无法帮助我。
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 https://cdn.discordapp.com/attachments/268002637905920001/506753130848059394/unknown.png
When I removed 当我删除
AttachDbFilename= E:\Downloads Mainframe\Compressed\Main Menu\HRDAssets.mdf;
new problem pops 新问题弹出
https://cdn.discordapp.com/attachments/506763196225421312/506763211492556800/unknown.png https://cdn.discordapp.com/attachments/506763196225421312/506763211492556800/unknown.png
Remove this line from the connection string 从连接字符串中删除此行
AttachDbFilename= E:\Downloads Mainframe\Compressed\Main Menu\HRDAssets.mdf;
and Initial Catalog property I suggest to use: 和初始目录属性,我建议使用:
Data Source=(LocalDb)\MSSQLLocalDB;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\HRDAssets.mdf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.