我已經有了一個名單經銷商和 strzipcode = Convert.ToString(dr["zero_to_50_miles"])
返回一個字符串:asp.net System.Collections.Generic.List排序在陣列
94323,87883,43434,24343 ...
我試圖理清所有郵政編碼從dearlers
有郵政編碼在strzipcode(94323,87883,43434,24343) 例 我的經銷商:
「A」, 「94323」
「B」, 「87883」
「C」, 「12345」
「d」, 「12345」
「E」, 「43434」
「F 」, 「12345」
「G」, 「12346」
「H」, 「24343」
「我」, 「12347」
因此,我希望我的新經銷商將
「A」, 「94323」
「B」, 「87883」
「E」, 「43434」
「H」, 「24343」
using (var dr = db.ExecuteDataReader("GetZipCodes", CommandType.StoredProcedure, param))
{
string strzipcode = "";
while (dr.Read())
{
strzipcode = Convert.ToString(dr["zero_to_50_miles"]);
}
string[] zipcodes = strzipcode.Split(',');
for (int a = 0; a < zipcodes.Length - 1; a++)
{
var cartr = (from i in dealers where i.Zipcode == strzipcode select i).ToList();
dealers.Find(cartr);
}
var cartr = (from i in dealers where i.Zipcode == strzipcode select i).ToList();
}
什麼768,16怎麼辦?
這裏是我的代碼 –
所以,要排序以相同的順序從'dearlers.zipcode'項目'zipcodes'對嗎?這個問題有點不清楚 – Marusyk
是的,它正是我想要做的,但有列表<>項查詢做到這一點。 –