Unable to Get the data from database

Nov 10 2009 1:49 PM

Hi, I am new to webservices, I create a webservice which give access to a database which stores some book details.

I created a webservice to get the book details, here is the code for that.

[WebMethod]
public DataSet getBookDetails()
        {
            DBConnection connect = new DBConnection();
            DataSet dataset = null;
            try
            {
               dataset = connect.connectToDB();
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
            return dataset;
        }

Where DBconnection class , connect to the database and connectTpDB method returns the book details in dataset. it is working fine in console application,

When I call this methos in this webmethod, it gives following wsdl file,

  <?xml version="1.0" encoding="utf-8" ?>
  <DataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:nil="true" xmlns="http://tempuri.org/" />

Is it correct? feel something wrong with that.
could someone please help me out on this?
Thanks



Answers (4)