What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 43440 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > Use of IDictionary in Asp.net? ...
Balajirnaukri@Gmail.Com

Use of IDictionary in Asp.net?

Replies: 3 | Posted by: Balajirnaukri@Gmail.Com on 4/27/2012 | Category: ASP.NET Forums | Views: 453 | Status: [Member] | Points: 10  


What is the use of IDictioary conept in Asp.net what is the exact usage of that?

Thanks and Regards
Balaji.R
ASP.NET Devloper
Solve-IT corp


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Sakthi.Singaravel
Sakthi.Singaravel  
Posted on: 4/27/2012 9:19:57 PM
Level: Silver | Status: [Member] | Points: 25

The IDictionary class is used for storing collections of key-and-value pairs.

Each element is a key-and-value pair stored in a DictionaryEntry object.

Each association must have a unique key that is not a null reference

for example,

See student,
Key - reg no
Value - name

We can retrive it using key values..
These key values like primary kay in SQL..


Regards,
Singaravel M

Balajirnaukri@Gmail.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sf_Hussain786
Sf_Hussain786  
Posted on: 4/28/2012 1:33:26 AM
Level: Starter | Status: [Member] | Points: 25

Can anybody Send me any program related to IDictionary????

sf_hussain786

Balajirnaukri@Gmail.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sakthi.Singaravel
Sakthi.Singaravel  
Posted on: 4/28/2012 2:01:13 AM
Level: Silver | Status: [Member] | Points: 25

VB .Net

Public Shared Sub Main() 


' Create a new dictionary of strings, with string keys,
' and access it through the IDictionary generic interface.
Dim openWith As IDictionary(Of String, String) = _
New Dictionary(Of String, String)

' Add some elements to the dictionary. There are no
' duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe")
openWith.Add("bmp", "paint.exe")
openWith.Add("dib", "paint.exe")
openWith.Add("rtf", "wordpad.exe")

' The Add method throws an exception if the new key is
' already in the dictionary.
Try
openWith.Add("txt", "winword.exe")
Catch
Console.WriteLine("An element with Key = ""txt"" already exists.")
End Try

End Sub


Regards,
Singaravel M

Balajirnaukri@Gmail.Com, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 6:19:23 AM