首页 > 代码库 > Linq中取得多个字段语法

Linq中取得多个字段语法

  ArrayList DnList = new ArrayList();
            using (var LinkToSQL = new LinkToSQLDataContext())//连接SQLServer数据库
            {
                var DneHead = from ee in LinkToSQL.CadDiameter
                             where ee.EHDia ==cbb_EDiameter.Text 
                             select new {ee.EHDia,ee.EHDiOro};
                foreach (var  n in DneHead)
                {
                    DnList.Add(n.EHDia .ToString());
                }
                cbb_DDiameter.Items.AddRange(DnList.ToArray());
            }