标签:
/// <summary> /// 返回状态数据 /// </summary> /// <param name="values"></param> /// <returns></returns> public DataSet RetuenStatusData(string[] values, out string message) { try { DataSet newDs = new DataSet(); DataTable newDt = new DataTable("StatusTable"); newDt.Columns.Add("Id"); newDt.Columns.Add("Value"); newDs.Tables.Add(newDt); Dictionary<string, string> disStatus = ReturnData(values); for (int i = 1; i <= disStatus.Count; i++) { DataRow newDr = newDs.Tables["StatusTable"].NewRow(); string value = string.Empty; disStatus.TryGetValue(i.ToString(), out value); newDr["Id"] = i.ToString(); newDr["Value"] = value; newDs.Tables["StatusTable"].Rows.Add(newDr); } message = string.Empty; return newDs; } catch (Exception ex) { message = ex.Message; return null; } }
标签:
原文地址:http://www.cnblogs.com/myblogslh/p/4922165.html