得到“表不存在”尝试在 Mango 本地数据库中的表中插入或选择时出错
我正在尝试为 Windows Phone 应用程序创建本地数据库。我可以很高兴地创建数据库,但看起来数据库中的表没有被创建,或者正在使用我不期望的名称创建。
有什么方法可以查看数据库中存在哪些表,或者我需要做一些额外的事情来创建表吗?还有其他人遇到过这个问题吗(您是如何解决的)?
I'm trying to create a local database for a Windows Phone application. I can create the database quite happily but it looks like the tables in the database are not being created or are being created with names I'm not expecting.
Is there any way to see what tables exist in the db or is there something extra I need to do to have the tables created? Has anyone else had this problem (and how did you solve it)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修好了。问题原来是“名称”属性引起了问题。尽管每列的名称与属性相同,但覆盖 SQL CE 数据库的属性并不喜欢它。我删除了该属性,问题就消失了。
Fixed it. Problem turned out to be the "Name" attributes were causing problems. Even though the name for each column was the same as the property the attribute was covering the SQL CE db didn't like it. I removed the attribute and the problem went away.
对于像您这样的情况,查看数据库总是一个好的开始。不过,您必须执行一些步骤:
阅读 此处查看完整教程。本教程使用 Visual Studio 连接到数据库,我使用 LinqPad。
Having a look into the database is always a good start in cases like yours. You have to perform some steps, though:
Read here for a complete tutorial. The tutorial uses Visual Studio for connecting to the DB, I use LinqPad.