Solved

IDictionary using a single string in place of 2 - IDictionary<string>

Posted on 2014-12-31
3
63 Views
Last Modified: 2015-06-11
The application I'm working on runs a report in SSRS.  I'm adding the parameters for a dropdown list.  The way that I'm pulling the list from the database has changed.  I'm now pulling a list of instructors from a table that only has the instructor name and no id, as I used before.  I was pulling and using the instructor ID and instructor Name for the key and value.  I now have only the instructor name.  So, I changed all of the entries in the application to have only a single string. and am using the
CONSTANT_DROPDOWNLIST_VALUE_NAME_DropDownList_Instructors.  However, I do get the error that it using the generic IDictionary requires 2 arguments.  It wants me to create a new class or type.  I've done a search in the application to find all code for the dropdownlist and changed them all.  Not sure what I need to do.  I've tried creating the class and that does clear the error.  But I'm not sure what to put in that class.
0
Comment
Question by:Sherry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 40526523
Just one note: The previous way to use ID and name was better. You should not use name as a unique key in your data. The name can change in time whereas the ID is unique and constant...

IDictionary always requires two arguments - that's the way all dictionaries work. If you need just one argument use IList or ICollection.

More info: http://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx

More info about IDictionary:
http://msdn.microsoft.com/en-us/library/xfhwa508%28v=vs.110%29.aspx
0
 

Author Comment

by:Sherry
ID: 40527969
I thought the ID and Name were better also.  I did get this to work by using the two arguments.  I used the same parameter for both.  I wasn't able to get the supervisor to add the ID to the table.  So, will do it her way.  Thank you for the response.  Happy New Year.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 40528172
Great workaround!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question