如何在vb.net中为LAN和服务器应用程序创建单个数据库 [英] how to have a single database for a LAN and server application in vb.net

查看:58
本文介绍了如何在vb.net中为LAN和服务器应用程序创建单个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个用VB.NET和SQL server表示的应用程序作为医院管理系统的后端。该应用程序将有两个部分--Vb.net应用程序将在局域网中工作,并将有一个网站,将使用VB的asp.net。人们可以直接在医院或网站上预约。现在,我的问题是如何为两者建立一个数据库。第二个问题是如何让vb.net应用程序在LAN上运行。

I am developing an application in VB.NET and SQL server express as backend for a hospital management system. The application will have two parts - the vb.net application will work in LAN and there will be a website which will be asp.net with VB. People will be able to book appointments directly in hospital or from website. Now, my question is how to have one database for both. And the second question is how to make the vb.net application work over LAN.

推荐答案

1)你应该有一台专用作SQL数据库的计算机。

2)您的vb.net应用程序将连接到连接字符串中定义的那台计算机

3)您的Web服务器也将连接到连接字符串中定义的SQL计算机。



祝你好运。



对于每台运行你的应用程序的计算机,YourApp.exe,你可以在每台计算机上安装该可执行文(还有其他的做法,但让我们使用这种部署方法)。开发YourApp.exe时,您需要连接到数据库;通常你会通过引用存储在配置文件中的连接字符串来连接到数据库。



连接字符串看起来像这样:

数据源= YourSQLserverName;初始目录= YourDBname;用户ID = YourUser;密码=虚拟



Web服务器将使用类似的连接字符串连接到数据库。
1) You should have one computer dedicated as the SQL database.
2) Your vb.net applicaiton will connect to that machine as defined in the Connection String
3) Your web server will also connect to that SQL machine as defined in a Connection string.

Good luck.

For each computer that will run your application, YourApp.exe, you can install that executable on each computer. (There are other ways of doing things, but let's use this deployment method). When you develop YourApp.exe, you will need to connect to a database; typically you would connect to the database by referencing a connection string stored in a configuration file.

The connection string would look something like this:
""Data Source=YourSQLserverName;Initial Catalog=YourDBname; User ID=YourUser;Password=dummy"

The web server would connect to the database using a similar connection string.


这篇关于如何在vb.net中为LAN和服务器应用程序创建单个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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