Problem with data in web service RRS feed

  • Question

  • Hi,

    Data from DataTable not showing.
    I am currently working on a web service that needs to update information from employees in active directory.
    I got a DataSet with two DataTables that returns data from a database.
    The bellow code is the one I am trying:

    [WebMethod(Description = "Get Employee Information From DB1")]

    public ServiceDS.EmployeeDataTable GetEmps() {

    ServiceDS.EmployeeDataTable empTA = new ServiceDS.EmployeeDataTable();

    return empTA;


    ServiceDS is the name for the DataSet.
    I still have not implemented any code for connecting to ADSI, I am trying to get this simple data to display.
    Forgot to mention I am new to web service, so any help will be very appreciated.
    Monday, April 14, 2008 7:59 PM


All replies

  • Before you return data through a web service, I recommend you first produce a bit of code, in a form you're familiar with, The code you posted does not return data from the database at all. If you're familiar with ASP.NET, write a small page. If Windows Forms, write a simple form. But first, use what you're familiar with to learn how to work with data.


    Then, bring it into the world of web services, that you're not familiar with.


    If you need help in just returning data, please let us know.


    Tuesday, April 15, 2008 12:09 AM
  • Could you please clarify what you mean when you say that the data from the DataTable is not "showing"?


    The WebMethod you posted creates a DataTable and then returns in to the requestor.  Is the problem that the requestor doesn't get any data in response to their request?  It doesn't look like your WebMethod populates the DataSet with anything - should it?  Or is the data somehow getting populated in the constructor?


    Daniel Roth

    Thursday, April 17, 2008 7:22 PM


    How can I returned the data when I hit the invoke button from the web service page.

    I already got a data set (ServiceDS) with a data table (ad), the web service is returning the schema from the table in this case from active directory.


    #region Employees from Active Directory

    [WebMethod(Description = "Get Employees from Active Directory")]

    public ServiceDS.adDataTable GetAdEmps() {

    ServiceDS.adDataTable ade = new ServiceDS.adDataTable();

    return ade;


    Any help will be very appreciated.


    Friday, April 18, 2008 6:40 PM
  • I'm sorry, but it doesn't seem that you understand what we're trying to tell you. The code you posted does not retrieve any data from a database. If you think it does, then it means that you do not know how to use ADO.NET to retrieve data from a database. Your problem has nothing to do with web services at all.


    Please ask this question at the ADO.NET DataSet forum.


    Saturday, April 19, 2008 12:22 AM
  • I'll move this thread to the ADO.NET forum for you.


    Daniel Roth

    Monday, April 21, 2008 10:10 PM

    I was just doing a tutorial from the web, I got it running now.


    I am new to this web services stuff.



    Friday, April 25, 2008 1:35 PM