Author: techissue2008 | Posted on: 9/4/2009 9:47:47 AM | Views : 501

 I need to return id, city in a List<>.

How can I convert dataset to List properly?

List<id, city>

I use C#
 
[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public List<string, string> BindCity(string provinceid) { DataSet ds = GetCity(provinceid); List<string, string> listData = new List<string, string>(); int ColumnCount = ds.Columns.Count; foreach (DataRow dr in ds.Rows) { listData.Add(dr); } return listData; } public DataSet GetCity(string provinceid) { DataSet ds = new DataSet(); try { using (SqlConnection Connection = new SqlConnection(Systems.CommonBase.ConnectionString)) { string commandstring ...

Go to the complete details ...