using System.Collections.Generic; using System.Data; using System.Linq; using Mesnac.Action.ChemicalWeighing.LjMaterial; namespace Mesnac.Action.ChemicalWeighing.LjPressure { public class PressureSettingDB: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; } } }