var metroquery = (from metro in objCommon.Lst_Cities
where (SqlMethods.Like(metro.CityNM, "Mumbai") ||
SqlMethods.Like(metro.CityNM, "Delhi" )||
SqlMethods.Like(metro.CityNM, "Kolkata") ||
SqlMethods.Like(metro.CityNM, "Chennai") ||
SqlMethods.Like(metro.CityNM, "Bangalore") ||
SqlMethods.Like(metro.CityNM, "Pune") ||
SqlMethods.Like(metro.CityNM ,"Ahmedabad") ||
SqlMethods.Like(metro.CityNM , "Hyderbad"))
select metro).ToList();
var nonmetroquery = (from metro in objCommon.Lst_Cities
where !metro.CityNM.Contains("Mumbai") &&
!metro.CityNM.Contains("Delhi") &&
!metro.CityNM.Contains("Kolkata") &&
!metro.CityNM.Contains("Chennai") &&
!metro.CityNM.Contains("Bangalore") &&
!metro.CityNM.Contains("Pune") &&
!metro.CityNM.Contains("Ahmedabad") &&
!metro.CityNM.Contains("Hyderbad")
select metro).ToList();
我写了这两份林克问询,以检索城市,并补充城市的第一线,即孟买和其他顶端城市。 第二点是,我只想向 com子看望的非流城市。
基本上,我想要在最上城市和非下游城市的城市举行有会议。
我为此使用了以下法典:
List<Lst_City> lstCity1 = new List<Lst_City>();
foreach (var t in metroquery)
{
lstCity1 = metroquery;
}
System.Threading.Thread.Sleep(200);
foreach (var t in nonmetroquery)
{
lstCity1 = nonmetroquery;
}
but I am getting only the non metro cities binded to the ComboBox.
任何帮助?