本地客户端读取WebService中的DataSet
来源:互联网 发布:淘宝手机怎么开店认证 编辑:程序博客网 时间:2024/05/16 01:44
WebSevice层代码:
[WebMethod]
public DataSet GetDataSet()
{
string connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("../App_Data/testdata.mdb");
string selstr = "Select space_single from [user] Where [userID]=" + "2" + "";
DataSet ds = new DataSet();
OleDbConnection objConn = new OleDbConnection(connstr);
OleDbDataAdapter adap = new OleDbDataAdapter(selstr, objConn);
adap.Fill(ds, selstr);
return ds;
}
注:connstr为连接Access数据库地址,selstr为查询的SQL的字符串。此两项可根据情况修改。
客户端代码:
public Form1(){
InitializeComponent();
WindowsFormsApplication1.datatest.datatest ss = new WindowsFormsApplication1.datatest.datatest();
DataSet ds = ss.GetDataSet();
dataGridView1.DataSource=ds.Tables[0];
}
注:1、使用该代码前,需要先添加WEB应用,这里将引用命名为:datatest
2、WindowsFormsApplication1为该方案的解决方案名,Form1为当前的窗体名
- 本地客户端读取WebService中的DataSet
- Webservice之Dataset传输[客户端]
- Jquery读取WebService、WebService返回DataSet常见问题
- webservice生成本地客户端调用
- C#读取DataSet中的数据
- dataset读取excel中的数据到打dataset中
- 利用wsdl2java生成本地WebService客户端
- 用xmlhttp读取webservice提供的dataset并写入table
- SqlDataReader 与 DataSet读取sql中的数据
- WebService——wsimport命令建立webService本地客户端
- 客户端访问WebService中的【客户端浅析】
- 客户端访问WebService中的【客户端浅析】
- 读取客户端文本文件中的数据
- 客户端读取HDFS中的数据
- 读取Excel中的信息 至DataSet,将DataSet中的资料导出到Excel
- 把excel文档中的内容读取到dataset中
- 客户端显示由WebService返回DataSet的GetXML()方法的返回值的方法
- WebService传输DataSet的
- 第一篇博客
- c#实现单链表的操作
- 金牛组
- BMP文件头格式 表
- CRM 全屏的方法
- 本地客户端读取WebService中的DataSet
- Head First C# 中文版 图文皆译 第十一章 事件和代理 page498
- Gentoo Linux ALSA Guide
- The GNOME Configuration HOWTO
- Time is going
- 夜,其实很美
- 上海之感
- HTML点滴
- Gentoo Linux Kernel Upgrade Guide