| | |
Help with Dictionary c#
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2007
Posts: 7
Reputation:
Solved Threads: 0
I am having a problem getting a value from my dictionary object. The TryGetValue Method returns true which indicates that it is finding the key in the dictionary but emps variable is not being populated with the value in the dictionary. What am I doing wrong?
thanks for your help!
thanks for your help!
asp.net Syntax (Toggle Plain Text)
private Dictionary<int, List<Employee>> _employees; protected void Page_Load(object sender, EventArgs e) { foreach (Schedule s in _departmentSchedules) { _employees.Add(s.ID, s.GetEmployees()); } List<Employee> emps; _employees.TryGetValue(15, out emps); Response.Write(emps.count); }
Last edited by peter_budo; Apr 25th, 2009 at 5:31 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- Dictionary ADT (Computer Science)
- Dictionary Keys (Python)
- Ways to create Dictionary (Python)
- Dictionary of Functions (Python)
- Merging Dictionary (Python)
Other Threads in the ASP.NET Forum
- Previous Thread: CMS Webcontent based on ID
- Next Thread: GridView Control
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose feedback flash flv form formatdecimal forms formview gridview homeedition iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols radio ratings reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml youareanotmemberofthedebuggerusers





