从 vb.net 创建 SQL Server 数据库,无需 SQL Server [英] Creating SQL Server database from vb.net, without SQL Server

查看:88
本文介绍了从 vb.net 创建 SQL Server 数据库,无需 SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 VB.net 中的应用程序编写安装程序.我的应用程序需要一个 SQL Server 数据库才能工作,但我希望我的应用程序在没有安装 SQL Server 实例的机器上运行.

I'm programming an installer for an application in VB.net. My application needs a SQL Server database to work, but I want that my app runs in machines without SQL Server instances installed.

存在 sqlcmd 独立还是其他什么?(我想将它包含在我的安装包中)

Exists sqlcmd standalone or something? (I would like to include it in my installation pack)

可以这样通过sqlcmd创建数据库吗?

Is possible create a database via sqlcmd this way?

谢谢

推荐答案

如果您想使用 SQL Server 数据库的全部功能,您需要安装一个 SQL Server 实例.如果问题是最终用户的成本,并且他们符合条件,则可以免费安装 SQL Server Express.

If you want to use the full power of the SQL Server Database you need to install an instance of SQL Server. If the problem is the cost for the final user, and they meet the criteria, they can install SQL Server Express, that is free.

但是,如果您的应用程序:

But, if your application:

  • 只使用数据库在本地持久化信息,你不需要与其他实例共享此信息在其他 PC 上运行的应用程序.
  • 使用 .NET 4.02 或更高版本.

您可以使用 SQL Server Express LocalDB,可用在 SQL Server 2012 或更高版本上.

You can use SQL Server Express LocalDB, available on SQL Server 2012 or later.

LocalDB 允许您使用 MDF 文件,像使用完整的 SQL Server 数据库一样工作,但有一些限制,无需安装和配置完整的 SQL Server 实例.

LocalDB lets you use MDF files and work like you were using a full SQL Server database, with some limitations, without the need of installing and configuring a full SQL Server instance.

您的安装程序可以启动 SQL Server Express LocalDB (SqlLocalDB.msi) 的安装,因此用户无需单独安装该产品.

Your installation program can launch the installation of SQL Server Express LocalDB (SqlLocalDB.msi), so the user don’t have to install the product separately.

这篇关于从 vb.net 创建 SQL Server 数据库,无需 SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆