Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-12-31
3
Medium Priority
?
86 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 43

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 43

Accepted Solution

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

916 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