Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
454 Points
88 Posts
Apr 26, 2012 06:14 AM|LINK
[WebMethod] public string hello() { string sConn = ConfigurationManager.ConnectionStrings["travel"].ToString(); string sSQL = "select *from tbl_login"; SqlConnection connCustomer = new SqlConnection(sConn); DataSet dsCustomer = new DataSet(); SqlDataAdapter daCustomer = new SqlDataAdapter(sSQL, sConn); daCustomer.Fill(dsCustomer,"Customers"); return "hello"; }
You need to return some string from the function. Check the return statement.
jigarbjpatel
Member
454 Points
88 Posts
Re: Error in Public method
Apr 26, 2012 06:14 AM|LINK
[WebMethod] public string hello() { string sConn = ConfigurationManager.ConnectionStrings["travel"].ToString(); string sSQL = "select *from tbl_login"; SqlConnection connCustomer = new SqlConnection(sConn); DataSet dsCustomer = new DataSet(); SqlDataAdapter daCustomer = new SqlDataAdapter(sSQL, sConn); daCustomer.Fill(dsCustomer,"Customers"); return "hello"; }You need to return some string from the function. Check the return statement.