-2
我有被内置了词典,低于查询字典,LINQ
Dictionary<string, string> GTNMobilelist = new Dictionary<string, string>();
GTNMobilelist = LoadMobileNumbers();
然后我需要查询字典来检查字典“中存在已enetered到一个文本框,一个手机号码希望是有道理的”: -/
这是我
foreach (GridViewRow HandSetRow in grdvHandSets.Rows)
{
TextBox txtmobileNumber = (TextBox)HandSetRow.FindControl("txtmobilenumber");
//I need the linq statement here if the mobile number doesnt exists i need to
//throw an error saying mobile number doesnt exist within the dictionary
//iv been looking at linq statements for the past hour and im confused :(
}
任何一个可以帮助我在这一个快速的解决方案?
这里你不需要LINQ,但是除非你给出一些有关字典结构的信息,任何人都可以回答这个问题吗? – Jon
注意,如果你的方法的结果如下所示,如果你的真实代码是这样的,那么只需声明它并删除'new'部分就可以实例化Dictionary。 – Wasp