“An attempt to attach an auto-named database” error

后端 未结 2 1815
半阙折子戏
半阙折子戏 2021-01-25 12:59

I am making a desktop application in C#, Visual Studio 2010 on Windows XP SP2 Professional.

If I run that application directly from the published folder without runnin

相关标签:
2条回答
  • 2021-01-25 13:22

    You are using ClickOnce and using a SQL CE database? Did you include the database in the Published application?

    0 讨论(0)
  • 2021-01-25 13:25

    Did you verify that the long path (C:\Documents and Settings\USER\Local Settings\Apps\2.0\Data\MP63M1NA.ZG5\BCOVJJWN.C53\smas..tion_ddac366ea7cca062_0001.0000_9c79a710d42895b6\Data\SmasDb.mdf) to see if there actually is a database there?

    From the three options in the error message, I would go for: or specified file cannot be opened

    You'll have to think about where you want the database to be (on a non-developer computer), and make sure it is copied there.

    See the post Working with Databases in Visual Web Developer 2005 Express Edition about the |DataDirectory| syntax.

    0 讨论(0)
提交回复
热议问题