Author: Skag55 | Posted on: 10/8/2009 5:31:36 AM | Views : 258

Hi all,
I've found a very nice piece of code that does what i need to do:
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [ScriptMethod(ResponseFormat = ResponseFormat.Json)] [WebMethod] public static List<Countries> CreateWorldMap( cid) { List<Countries> countries = new List<Countries>(); SqlConnection myConn; SqlDataReader myReader; SqlCommand myComm, myComm2; myConn = new SqlConnection("server=www.myserver.co.uk;database=myDB;uid=sa;pwd=pass;"); myComm = new SqlCommand("select distinct country, count (country) from xxxxxxxxxx xxxx xx xx ", myConn); myConn.Open(); myReader = myComm.ExecuteReader(); int count = 0; while (myReader.Read()) { cou ...

Go to the complete details ...