如何将 ADO.net 实体数据模型导出到 .mdf 文件?

发布于 2024-09-18 16:04:15 字数 411 浏览 2 评论 0原文

我创建了我的第一个 ADO.net 实体数据模型。 其中有 2 个表(没有关系,只是简单的表)。

在我的项目的 App_Data 目录中,有一个名为 trans.mdf 的(空)mdf 文件。

当我在 ADO.NET 模型中选择“从模型生成数据库” 时,我可以在对话框中选择我的 trans.mdf

然后它构建 ddl 和 sql 文件。

下一步是执行生成的 .sql 文件。在这里我完全迷失了。当我选择上传时,出现一个来自sql server 2008的身份验证框。最后它告诉我连接失败。

如何执行trans.mdf中的.sql

非常感谢您的帮助:)

I've created my first ADO.net entity data model.
In it there are 2 tables (with no relations, just simple tables).

In my Project's App_Data directory there is an (empty) mdf file called trans.mdf.

When I select "Generate database from model" in the ADO.NET model, I can select my trans.mdf in the dialog.

It then builds the ddl and sql file.

The next step then is to execute the generated .sql file. And here I'm totally lost. When I select upload, there comes an authentication box from sql server 2008. And finally it tells me that the connection failed.

How can I execute the .sql in the trans.mdf?

Thanks a lot for any help :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神回复 2024-09-25 16:04:15

该视频展示了如何生成所需的 SQL 语句,然后连接到 SQL 2008 以使事情顺利进行。 以模型优先的方式创建实体数据模型< /a>.

this video shows how to generate the needed sql statements and then connect to a SQL 2008 to get things going. Creating an Entity Data Model the Model-First Way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文