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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:33:14+00:00 2026-06-15T19:33:14+00:00

I just want to insert some data from a datatable to a list. Here

  • 0

I just want to insert some data from a datatable to a list.

Here is my class:

class WhereColumnValue
{
    private string columnName;

    public string _columnName
    {
        get { return columnName; }
        set { columnName = value; }
    }

    private string setValue;

    public string _setValue
    {
        get { return setValue; }
        set { setValue = value; }
    }

    private bool setValueStatus;

    public bool _setValueStatus
    {
        get { return setValueStatus; }
        set { setValueStatus = value; }
    }
}

Now i have a list of WhereColumnValue type.

List<WhereColumnValue> lstWhereColumnValue = new List<WhereColumnValue>();

How could I insert data to this lstWhereColumnValue?

I have tried following code:

foreach (DataRow tmp in dtAllColumnData.Rows)
            {
                lstColumn.Add(tmp["COLUMN_NAME"].ToString());
                lbTableColumns.Items.Add(tmp["COLUMN_NAME"]);
                lstWhereColumnValue.Add(***);

            }

I have to add an item here(*). but i only have value for _columnValue. Rest two will remain null. how would i do this?

  • 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-15T19:33:16+00:00Added an answer on June 15, 2026 at 7:33 pm

    You need to instantiate your class and add filled-out instances of it to your list. Something like this:

    foreach (DataRow tmp in dtAllColumnData.Rows)
    {
        WhereColumnValue val = new WhereColumnValue();
        val._columnName = tmp["COLUMN_NAME"];
        val._setValue = tmp{"SET_VALUE"];
        ....
        lstColumn.Add(val);
    }
    

    You may also want to follow naming conventions and have your properties be ColumnName, SetValue, etc.

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

Sidebar

Related Questions

Use case: I've just entered insert mode, and typed some text. Now I want
I just want to add some extra text on top of input posted from
all. I want to insert some initial data in db(sqlite) when it was created.
I've just discovered (by necessity) that TSQL has some functionality to extract data from
So I have a PHP backend that pulls some data from SQL, let's just
I want to add some data from a NSMutableArray to my UITableView . I
I am trying to insert some data from one table into another but I
Just want to know how to read an attribute of a parent node from
I've got some soapUI tests, that use groovy scripts to first insert some data
I want to build a service that will pass the data read from the

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.