如何在网络(LAN)中开发数据库应用程序 [英] How to develop database application in Network(LAN)

查看:75
本文介绍了如何在网络(LAN)中开发数据库应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨代码项目朋友,



我要求能够开发数据库应用程序,我的想法很简单。

我想在局域网中开发客户端/服务器应用程序,服务器获取数据库,客户端需要以远程方式调用此数据库。客户端如何调用服务器(他如何发送请求以获得重新启动)。



我很抱歉,我正在尽我所能改善我的英语。谢谢

Hi codeproject friends,

I''m asking to day for am able to develop an database application, my idea is simple.
I want to develop an client/server application in LAN, the server takes the database and the client need to invoke this database as remote. How can the client invoke the server(how can he send the request an obtain respense).

I''m so sorry, i''m doing my possible to ameliorate my English. Thank You

推荐答案

我假设您不打算从头开始编写teh dabase服务器 - 这对项目来说是一个非常愚蠢的开始! :笑:



在其中一台PC上安装SQL服务器 - Express版本适合初学者 - 然后你只需要一些代码在客户端运行一个连接字符串:

尝试:
I assume you aren''t planning on writing teh dabase server from scratch - that would be a very silly start to teh project! :laugh:

Install SQL server on one of the PCs - the Express version is fine for starters - and then you just need some code to run at the client and a connection string:
Try:
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand com = new SqlCommand("SELECT iD, description FROM myTable", con))
        {
        using (SqlDataReader reader = com.ExecuteReader())
            {
            while (reader.Read())
                {
                int id = (int) reader["iD"];
                string desc = (string) reader["description"];
                Console.WriteLine("ID: {0}\n    {1}", iD, desc);
                }
            }
        }
    }



要查找连接字符串,请尝试建立连接在VS中使用Server Explorer窗格:

1)打开服务器资源管理器。

2)右键单击数据连接并选择添加连接

3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接按钮。

4)当连接有效时,按确定

5)在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。


To find the connection string, try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.


听到的是程序:



我在vb中创建了一个项目



首先创建一个项目



编译那个应用程序,让它成为EXE应用程序



i我正在使用windows7,所以我通过控制面板安装了iis7.5



现在使用iis配置您的EXE应用程序



在iis中选择您的文件夹并转到安全选项卡将其更改为Everyone



就是这样,现在您的应用程序可通过局域网获得。



vas.shrinivas002@gmail.com
Hear is the procedure:

I have created a project in vb

first create a project

compile that application,Make it EXE application

i am useing windows7,So i installed iis7.5 through control panel

now configure your EXE application with iis

Select your folder in iis and go to security tab change it to Everyone

That''s it,Now your application available throught LAN.

vas.shrinivas002@gmail.com


这篇关于如何在网络(LAN)中开发数据库应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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