Solved

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

Posted on 2014-12-31
3
42 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
  • 2
3 Comments
 
LVL 41

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 41

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now