LINQ EF 未保存到数据库
我想这是我问的最后一个问题的延续: bulk使用 ADO.NET 实体框架插入和更新。
我在执行插入时没有收到任何错误,但实际上没有数据进入我的数据库。我的数据库是一个SDF文件(SQL CE)。有什么想法要检查什么吗?
我的 app.config 如下所示:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Lab_Use_Billing.Properties.Settings.LabUseConnectionString"
connectionString="Data Source=|DataDirectory|\Models\LabUse.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
<add name="LabUseEntities"
connectionString="metadata=res://*/Models.LabUseEntities.csdl|res://*/Models.LabUseEntities.ssdl|res://*/Models.LabUseEntities.msl;
provider=System.Data.SqlServerCe.3.5;
provider connection string="Data Source=|DataDirectory|\Models\LabUse.sdf""
providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
TIA
I guess this is a continuation of the last question I asked: bulk insert and update with ADO.NET Entity Framework.
I am not getting any errors while doing inserts yet no data is actually going into my DB. My DB is a SDF file (SQL CE). Any ideas what to check?
My app.config looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Lab_Use_Billing.Properties.Settings.LabUseConnectionString"
connectionString="Data Source=|DataDirectory|\Models\LabUse.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
<add name="LabUseEntities"
connectionString="metadata=res://*/Models.LabUseEntities.csdl|res://*/Models.LabUseEntities.ssdl|res://*/Models.LabUseEntities.msl;
provider=System.Data.SqlServerCe.3.5;
provider connection string="Data Source=|DataDirectory|\Models\LabUse.sdf""
providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
让我猜猜,您的数据库是您计算机上的本地数据库吗?尝试在项目调试文件夹中查找数据库,看看是否有您的更改...
只需将调试数据库添加为服务器资源管理器中的新连接,然后刷新以查看是否有更改...
Let me guess, your DB is a local database on your computer? Try looking in the project debug folder for a database and see if that has your changes...
Just add the debug database as a new connection in the server explorer and refresh to see if the changes are there...
您可以发布用于在数据库中创建行的代码吗?
我假设您正在新建一个对象上下文,然后使用类似以下内容的内容:
Can you post the code you are using to create the rows in the database?
I assume you're newing up an object context and then using something like: