Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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";
Updated 22-Mar-11 19:31pm
Wendelius 22-Mar-11 13:42pm    
Pre tags removed

1 solution

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
Share this answer
Member 7776241 28-Mar-11 8:52am    
I tried both ways (1st run the WCF service, then started the Windows application to display the datagrid, it is not getting the data. Tried using local IIS way, that also did not display the data in data grid)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900