部署使用 SQL Server 2008 Express 的应用程序时出现问题
我用 Visual C# 为我的大学项目开发了一个应用程序,它使用 SQL Server 2008 Express 数据库。 我的应用程序是基于桌面的。 但现在的问题是部署应用程序。 是否需要在客户端计算机上安装 SQL Server 2008(插入我的表和数据),或者我可以只导出 .mdf 文件并且一切正常吗?
有没有办法避免在目标计算机上安装 SQL Server 2008?
抱歉,刚刚找到了重复项: 如果我使用 .mdf 文件部署应用程序,用户是否需要安装 SQL 2008 Express?
I've developed an application for my college project in Visual C# which uses SQL Server 2008 Express database. My application is desktop-based. But the problem now is deploying the application. Is it required that a SQL Server 2008 be installed on the client machine (with my tables and data inserted) or can I just have the .mdf file exported and everything works well?
Is there a way to escape the installation of SQL Server 2008 on the target machine?
Sorry, just found a duplicate: Does user need SQL 2008 Express Installed if I deploy app with .mdf file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 SQL Server Express 与您的应用程序一起部署。 然而,大多数时候这是错误的做法。 SQL Server Express 是服务器级数据库,因此喜欢消耗系统资源。 它还作为服务运行,这意味着即使您的应用程序未处于活动状态,它也会使用这些资源。
相反,您应该选择桌面(或进程内)类引擎,例如 SQL Server Compact Edition、Sqlite 甚至 MS Access。 除了作为桌面程序的全面更好选择之外,这些数据库通常也更容易部署。
You can deploy SQL Server Express with your application. However, most of the time this is just the wrong thing to do. SQL Server Express is a server-class database, and likes to use up system resources as such. It also runs as service, which means it's using those resources even when your application isn't active.
Instead, you should choose a desktop (or in-process) class engine, like SQL Server Compact Edition, Sqlite, or even MS Access. In addition to being an all around better choice for your desktop program, these database will also generally be much easier to deploy.