通过WCF服务使用DataSet对象的问题 [英] Problem in Consuming DataSet object via WCF Service

查看:203
本文介绍了通过WCF服务使用DataSet对象的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WCF初学者.我正在研究带有Windows服务托管的WCF服务库,文章日期为2009年7月15日".

在消费WCF服务步骤之前,我能够成功地按照本文进行操作.正如作者所说,在测试Microsoft提供的WCF测试客户端时,GetJobs()不可用.那没问题.

在ConsumeJobs步骤中,"DataSet"对象未检索任何数据.有人在这一步成功吗?如果是这样,请帮助我如何使用DataSet从WCF中的数据库中检索数据.
这是我的代码:

I am a beginner WCF developer. I was working through the "WCF Service Library with Windows Service Hosting Article date 15th, July 2009".

I was able to successfully follow the article till Consuming WCF Service step. As author says while testing the WCF Test Client provided by Microsoft, GetJobs() was not available. That is OK.

In ConsumeJobs step the "DataSet" object is not retrieving any data. Anybody is successful in this step? If so please help mehow to use DataSet to retrieve data from database in WCF.
Here is my code:

private void btnShowAll_Click(object sender, EventArgs e)
{
  txtMsg.Text = "Program is inside show all click";
  dataGridView1.BackgroundColor = SystemColors.Window;
  JobsService.JobsClient obj = new ConsumeJobs.JobsService.JobsClient();
  DataSet ds = new DataSet();
  ds = obj.GetJobs();
  dataGridView1.DataSource = ds;
  dataGridView1.DataMember = "Jobs";
}

推荐答案

我也遇到了同样的问题
您需要在本地IIS中创建该wcf服务.另一种选择是,您必须在运行应用程序之前运行该服务
hi i have faced the same problem
you need to create that wcf service in the local IIS another option is you have to run that service before running your application


这篇关于通过WCF服务使用DataSet对象的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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