如何将LightSwitch连接到共享网络PC驱动器中的SQL数据库。 [英] How do I connect LightSwitch to SQL database which is in a shared network pc drive.

查看:120
本文介绍了如何将LightSwitch连接到共享网络PC驱动器中的SQL数据库。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要将我的Visual Studio LightSwitch与VB.NET项目连接到SQL数据库,该数据库位于本地网络上的共享驱动器上。 。



数据库名称是:Proj2014DB.mdf

包含数据库的PC名称是:PCNO10

驱动器在包含数据库的PCNO10上是驱动器:D:\ MyDatabase \



当试图发布我的项目以便通过网络工作时Visual Studio LightSwitch问我向数据库提供SQL用户连接字符串,以便在发布后能够连接到数据库。



所需的连接字符串格式为:



数据源= PCNO01-PC ;初始目录= Proj2014 ;集成安全性=真;池化=真;连接超时= 30;用户实例=错误



我的问题是什么是正确的连接字符串,以确保网络上的所有电脑都能识别nect到上面提到的数据库(我认为它们标有粗体文字,需要更正)。





提前致谢

Maher

Hi all,

I need to connect my Visual Studio LightSwitch with VB.NET project to SQL database which is located on a shared drive on a local network ..

Database Name is: Proj2014DB.mdf
The PC name containing the DB is: PCNO10
Drive on PCNO10 containing the DB is drive: D:\MyDatabase\

When trying to publish my project to be shared for working over the network Visual Studio LightSwitch asks me to provide the SQL user connection string to the database to be able to connect to the database after publishing.

The required connection string is in the format:

Data Source=PCNO01-PC;Initial Catalog="Proj2014";Integrated Security=True;Pooling=True;Connect Timeout=30;User Instance=False

My question is what is the correct connection string to make sure all pcs on the network will connect to the database mentioned above (I think they are marked with bold text which need to be corrected).


Thanks in advance
Maher

推荐答案

假设Proj2014.mdf所在的PC设置为正确运行SQL Server(或Express或LocalDB) ,包括PC名称(或IP地址)\ SQL Server名称。见下文:



数据源= PCNO01-PC\SQLEXPRESS ;初始目录=Proj2014;综合安全性=真;汇总= True; Connect Timeout = 30; User Instance = False
Provided that the PC that the Proj2014.mdf is located on is setup to properly run SQL Server (or Express or LocalDB), include the PC Name (or IP Address)\ SQL Server name. See below:

Data Source=PCNO01-PC\SQLEXPRESS;Initial Catalog="Proj2014";Integrated Security=True;Pooling=True;Connect Timeout=30;User Instance=False


需要在具有数据库文件的PC上安装。根据需要,有不同的版本可供选择:



LocalDB - 在本地PC上 - 非常适合开发和测试



SQL Express - 非常适合在少数用户的网络中轻松使用。



SQL Server - 高端使用
It will need to be installed on the PC that has the database file. Based on the needs, there are different versions to look at:

LocalDB - on a local PC - Great for Developing and Test

SQL Express - Great for light use across the network with a few users.

SQL Server - High-End use


这篇关于如何将LightSwitch连接到共享网络PC驱动器中的SQL数据库。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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