An Attempt to attach an auto-named database Error

前端 未结 6 771
名媛妹妹
名媛妹妹 2020-12-03 21:48

\"An attempt to attach an auto-named database for file C:\\Users\\John\\documents\\visual studio 2010\\Projects\\PAS\\PAS\\bin\\Debug//PatAddSys.mdf failed. A database with

6条回答
  •  一向
    一向 (楼主)
    2020-12-03 22:33

    FOR FUTURE HELP !!

    you've corrected it:

    private string dbPath = Application.StartupPath + "//PatAddSys.mdf";
    

    BUT just have to do one step is to use the Backslash " \ " instead of SLASH " / " so it should to be like this :

    private string dbPath = Application.StartupPath + "\\PatAddSys.mdf";
    

    &thanks this line saved me alot of work :)

提交回复
热议问题