客户端PC上的LocalDB部署

客户端PC上的LocalDB部署

本文介绍了客户端PC上的LocalDB部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个新版本的SQL Server Express非常吸引我.

I am very intrigued by this new version of SQL Server Express.

(对我而言)尚不清楚安装程序应如何部署使用LocalDB的应用程序.

It's not clear (to me) what a setup program should do to deploy an application that use a LocalDB.

是否需要在客户端PC上安装SQL Server Express,然后附加MDF文件?

Is it required to install SQL Server Express on the client PC and then attach the MDF file?

还是只需要运行LocalDB.msi,它就可以像SQL Server Compact一样作为独立文件使用?

Or it's only required to run the LocalDB.msi and it works as a standalone file like SQL Server Compact?

推荐答案

您不需要安装SQL Server Express即可使用LocalDB,因为LocalDB是SQL Server Express,因此更易于安装.

You don't need to install SQL Server Express to use LocalDB, as LocalDB is SQL Server Express, just easier to install.

一旦安装了LocalDB,就可以使用连接字符串的AttachDbFileName属性打开" MDF文件.请记住,同一文件只能在任何给定时间由单个LocalDB实例(单个Windows登录)打开,因此这不是数据共享功能.

Once LocalDB is installed you can use AttachDbFileName property of the connection string to "open" an MDF file. Keep in mind that the same file can only be opened by a single LocalDB instance (single Windows login) at any given time, so this is not a data-sharing feature.

更新:如果您的应用程序使用.NET,请确保安装.NET 4.0.2或更高版本,如此处.原始.NET 4无法理解LocalDB连接字符串,因为它早于LocalDB.

Update: If your application is using .NET, make sure to install .NET 4.0.2 or newer, as mentioned here. The original .NET 4 doesn't understand LocalDB connection strings, as it shipped long before LocalDB.

这篇关于客户端PC上的LocalDB部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 23:06