code for webservice that returns DataSet?

Srilu.Nayini577
Posted by Srilu.Nayini577 under Others category on | Points: 40 | Views : 1164
using system.Data;
using System.Data.SqlClient ;

[WebMethod]
public DataSet GetEmpData()
{

sqlconnection con=new sqlconnection("Data Source=serverName;User Id=id;password=password;Initial Catalog=DataBaseName");

sqlDataAdapter da=new sqlDataAdapter("select * from Emp",con);
DataSet ds=new DataSet();
da.Fill(ds,"a");
return ds;
}

Comments or Responses

Login to post response