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 7922101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:50:24+00:00 2026-06-03T16:50:24+00:00

I am still learning the MVVM pattern and am making a new project(C#4.0 &

  • 0

I am still learning the MVVM pattern and am making a new project(C#4.0 & WPF) which involves SQLite databases. I haven’t used databases(sql) much in the past, but what I would do is something like this:

Select * from persons;

then loop through the result and foreach result add it in the persons class, something like

result[0] = person.name; 
result[1] = person.id; 

et cetera. Then I would use a for loop until I went through all the rows and added all the players to a List (or ObservableCollection for MVVM). Now I want to be more dynamic, since I’ll have many more rows I am looking for something like:

Person personone = "Select * from persons where ID = 1";

But this doesn’t work, of course. I have been tried searching for my question on Google but have not found an answer. I found SQL to LINQ but it is not really the thing I am looking for. The most relevant thing I found is the massive sqlite class, but it doesn’t seem to work with VS11 as it appears to have been deprecated.

How can I more dynamically insert data from SQLite into a class?

  • 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-06-03T16:50:25+00:00Added an answer on June 3, 2026 at 4:50 pm

    Dapper is a nice solution for this. You can map the results of your query to custom POCOs, or to dynamic objects.

    Mapping the query results to an object is as simple as:

    var cn = ... //create your db connection
    IEnumerable<MyClass> myList = cn.Query<MyClass>("select * from MyTable").ToList(); 
    

    For a single instance, you would do this:

    MyClass myInstance = cn.Query<MyClass>("select * from MyTable where id = 1").SingleOrDefault(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still learning WPF....thanks for any help. Is there any way to Refactor this: <ListBox
I'm still learning the WPF ropes, so if the following question is trivial or
Still learning this stuff on WPF, themes, derivations, etc. I understand basics on the
I am still learning Python and as a little Project I wrote a script
I'm still learning jQuery and I haven't figured out some of the concepts yet,
I am working on a WPF app using the MVVM patterm, which I am
Still learning MySQL, so bear with me. So I have two tables: leads, which
I'm still learning the basics and I'm making a Random Character Generator that creates
I am still learning to use MVVM and Prism and have some general questions:
I'm still learning to code in AS3, which seems pretty straight forward and similar

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.