Solved

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

Posted on 2014-12-31
3
36 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

746 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

15 Experts available now in Live!

Get 1:1 Help Now