using System.Collections.Generic; using System.Data; using Mesnac.Action.ChemicalWeighing.LjMaterial; namespace Mesnac.Action.ChemicalWeighing.LjDevice { public class DeviceHelp:DBHelp { public static IList GetAllNameValue() { var dataTable = GetTable("select Id,Name from PressureSetting"); var dr = dataTable.Rows; IList ls = new List(); foreach (DataRow o in dr) { ls.Add(new MyNameValue() { Id =(int)o["Id"], Name = o["Name"].ToString() }); } return ls; } } }