I have a WinForm application and I also use a web service in this project. The problem is that;
There is 3 project in the solution. I>Data layer, II>Service Layer, III>Presentation Layer. There is some of typed DataSet in Data Layer and I can fill and return this dataset to the presentation layer without any problem. On the other hand, when I try to return a datatable in this dataset, the datatable returns empty. I checked and obtain that; the typed datatable is filled in Data Layer and returns to Service layer. The datatable is still fill on the service layer. But, when return it to the application layer, it is getting empty. Here is the sample code I used. I think DataTables can be returned on webservices as DataSets. I use Typed Datatable but it should be returned as well. Am I wrong?
On the Data Layer:
public StudentDS.EXAMSDataTable ExamTable()
SelectAll(dataSet.EXAMS); return dataSet.EXAMS;
On the Service Layer:
[WebMethod(Description = "Returns EXAMS datatable")]
public StudentDS.EXAMSDataTable WsExamTable()
StudentDS.EXAMSDataTable dt = myDataAccess.ExamTable(); return dt; }
On the Presentation Layer:
private void btFill_Click(object sender, EventArgs e)
dataGridView1.DataSource = myService.WsExamTable(); }
So, is there a mistake or how can I return filled datatable from a web service?