Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to add a dictionary ,list in SQL server database. But dictionary,list are nested, means, those are have multiple list inside.

C#
Dictionary<int, List<int>> Map_list = new Dictionary<int, List<int>>(); 
           List<List<int>> cover_index_code = new List<List<int>>();


I need to store Map_list in a column, and cover_index_code in another column in a single row.And need to retrieve that values also.

Please anyone suggest any ideas to accomplish this.!

Thanks in Advance!
Posted
Updated 7-Dec-15 20:46pm
v2

1 solution

For this kind of relationship you need two tables. One for the key and another for the nested list. You can populate the dictionary at runtime or you can use linq to create a dictionary. It depends on how you fetch data from the db
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900