Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 52
Connecting to multiple databases to create a Dashboard 5 65
backup program with robocopy 6 70
Visual Studio hangs on running project 6 58
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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