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?
Is it correct? feel something wrong with that.
could someone please help me out on this?
Purushottam RathorePosted Nov 17, 2009, 3:13 AM
Thanks
suthakaran sivabalanPosted Nov 12, 2009, 10:35 AM
out. Thanks a lot..
Purushottam RathorePosted Nov 12, 2009, 7:34 AM
public DataSet GetUserId()
{
SqlConnection con = new SqlConnection("Data Source = (local); Initial Catalog = databasename; User ID = userid; Password = password;");
string cmd = "select * from tablename";
SqlDataAdapter da = new SqlDataAdapter(cmd, con);
con.Open();
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
return ds;
}
Dipen LamaPosted Nov 10, 2009, 5:16 PM