Use the tool VS2010 to generate a project 1. Generate a webservice project: Create an ASP. NET empty WEB application. 2. Create a new "WEB Service" in the ASP. NET empty web application ". To complete the above content project structure, the main operation below is in webservice1.asmx. cs file, which contains several services, two simple services, two query database services; using System. collections. generic; using System. linq; using System. web; using System. web. services; using System. data. sqlClient; using System. data; using MySql. data; using MySql. data. mySqlClient; namespace webservice {// <summary> // summary of WebService1 /// </summary> [WebService (Namespace = "http://tempuri.or G/")] [WebServiceBinding (ConformsTo = WsiProfiles. basicProfile1_1)] [System. componentModel. toolboxItem (false)] // to allow ASP. net ajax calls this Web service from the script. Please cancel the comments to the downstream. // [System. web. script. services. scriptService] public class WebService1: System. web. services. webService {[WebMethod] public string HelloWorld () {return "Hello World";} [WebMethod] public int GetSum (int a, int B) {return a + B ;} [WebMethod] public DataSet query () {DataSet ds = new DataSet (); string connstring = "Database = test; Data Source = localhost; User Id = root; Password = root "; mySqlConnection mycn = new MySqlConnection (connstring); mycn. open (); MySqlDataAdapter mda = new MySqlDataAdapter ("select * from stock_data", mycn); mda. fill (ds, "stock_data"); return ds;} [WebMethod] public DataSet goldprice () {DataSet ds = new DataSet (); string connstring = "Database = test; data Source = localhost; User Id = root; Password = root "; MySqlConnection mycn = new MySqlConnection (connstring); mycn. open (); MySqlDataAdapter mda = new MySqlDataAdapter ("select * from goldprice", mycn); mda. fill (ds, "stock_data"); return ds ;}}}