Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4621282
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:40:43+00:00 2026-05-22T02:40:43+00:00

I have a table in database as follows… ID(INT) Values(VARCHAR(50)) 1 200,300 2 100

  • 0

I have a table in database as follows…

ID(INT)    Values(VARCHAR(50))  
1          200,300  
2          100  
3          400,500  

when I query, I need to get this data in a Dictionary>

The code I have so far is…

var x = (from o in Values
select o).ToDictionary(o=>o.ID, p=>p.Values)

I would like the p.Values to be converted to a List so I also need to perform a Convert.ToInt32() possibly!
Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:40:44+00:00Added an answer on May 22, 2026 at 2:40 am

    This should work:

    var x = 
    (from o in Values select o)
    .ToDictionary(o => o.ID, 
                  p => p.Values.Split(',')
                        .Select(x => Convert.ToInt32(x))
                        .ToList());
    

    .Select(x => Convert.ToInt32(x)) can be converted to a method group like this 😉 .Select(Convert.ToInt32)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have database table whose structure is as follows: id int name varchar(20) dob
I have a database table as follows: create table Table1( Date varchar(10), Batch_Name varchar(50),
I have a table in a postgresql-9.1.x database which is defined as follows: #
In my database, assume we have a table defined as follows: CREATE TABLE [Chemical](
Let's assume that I have a table in a mysql database as follows, date
My use case is as follows -- I have a database table with around
Today's problem is as follows: we have a table in an Oracle database. The
I'm making a database and have a table structured as follows Att1 Att2 Att3
I have a table structure as follows. Now I need to sort these nested
I have a Database table containing product information as follows: ProductID, KeywordID, ProductDescription and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.