将数据集对象从服务器传递到客户端 [英] Passing dataset object from server to client

查看:104
本文介绍了将数据集对象从服务器传递到客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我正在使用套接字在vb.net中创建数据库以及服务器/客户端应用程序
我想在客户端显示数据库记录,这是客户端选择的查询的基础.


我正在使用数据集和oledbdataadapter.
我的数据源在服务器端.
在客户端,我想在datagrid中显示结果.
我的后端是MS Access.

Guys I am creating a database as well as server/client application in vb.net using socket
I want to display the database records on the client side an the basis of the query selected by the client.


I am using dataset & oledbdataadapter.
My datasource is on the server side.
On the client side I want to display the result in datagrid.
My backend is MS Access.

推荐答案

如果这是一个Web应用程序,则使用GridView.DataSource和GridView.DataBind,它们至少会做基础. >
如果这是WinForms,则只需将数据集发送到客户端(如果可以访问DB,则直接在客户端生成它),然后使用DataGridView.DataSource.
If this is a web app, then use GridView.DataSource and GridView.DataBind which will do the basics at least.

If this is a WinForms, then just send the dataset to the client (or generate it at the client directly if it has access to the DB) and use DataGridView.DataSource instead.


只需获取数据库中的数据并将其填充到数据表中.然后使用下面的代码.
Just fetch the data from database and fill it in datatable. Then use below code.
GridView.DataSource = datatable
GridView.DataBind()


检查一下.
对于Web: http://programming.top54u.com/post/ASP -Net-GridView-DataBinding-using-VB-Net.aspx [ http://gridview.wordpress.com/2010/05/05/vb-net-datagridview-databinding/ [ ^ ]


Check this.
For Web: http://programming.top54u.com/post/ASP-Net-GridView-DataBinding-using-VB-Net.aspx[^]

For Winforms: http://gridview.wordpress.com/2010/05/05/vb-net-datagridview-databinding/[^]


这篇关于将数据集对象从服务器传递到客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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