在C#Windows应用程序中将客户端连接到服务器 [英] connect client to server in c# windows application

查看:105
本文介绍了在C#Windows应用程序中将客户端连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

现在,我已成功基于IP地址连接了客户端和服务器.我在客户端的连接字符串是(数据源= 192.168.x.x(服务器IP),初始目录= aaa,用户= sa,密码=''xxx'').数据已成功保存到客户端和服务器.但是现在我的问题是仅在启用Internet时存储数据,否则我的数据仅存储在客户端.
这里有一个新想法,即如果在没有Internet的情况下将数据存储在客户端中,但在客户端服务器之间启用连接后,数据将自动传输到服务器".这是否可能,如果是,请说出您的宝贵意见建议..



在此先感谢

Dhinesh Kumar.V

Hi all,

Now am successfully connect client and server based on ip address. my connection string at client is (Data Source=192.168.x.x(server IP),Initial Catalog=aaa,User=sa,Password=''xxx''). Data are successfully saved both client and server. But now my problem is data are stored only when the internet is enable otherwise my data are stored only at client side.
here am think new idea that is "if the data is stored in client when no internet but after the connection is enable between client server the datas are automatically transferred to server".. Is this possible or not, if YES means please say your valuable suggestions..



Thanks in Advance

Dhinesh Kumar.V

推荐答案

有点奇怪-192.168.xx不是互联网IP地址-它是您本地LAN设置的一部分(它''一个保留的地址范围).

至于稍后将客户端数据更新到服务器数据库上的数据,您应该查看的过程是复制,它比您想象的要复杂一些.

在这里开始阅读: http://msdn.microsoft.com/en-us/library/ms151198.aspx [ ^ ]-但是不要不希望这是五分钟的工作!
That''s a bit odd - 192.168.x.x is not an internet IP address - it''s part of your local LAN setup (it''s a reserved address range).

As for client data later being updated onto a server DB, the process you shoudl be looking at is Replication, and it is a bit more complex than you think...

Start reading here: http://msdn.microsoft.com/en-us/library/ms151198.aspx[^] - but don''t expect it to be a five minute job!


这篇关于在C#Windows应用程序中将客户端连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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