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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:45:55+00:00 2026-05-20T23:45:55+00:00

I have an expression as ((ID + DepartmentID)*ID) as ExpressionColumn where ID,department are the

  • 0

I have an expression as “((ID + DepartmentID)*ID) as ExpressionColumn” where ID,department are the columns of a datatable. How to execute the expression for each datarow and add new column to the datatable as “ExpressionColumn”. Since the expression can vary based on User’s selection, Kindly help me with a generic code to calculate the expression for each row/column and add new column to the datatable.

  • 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-20T23:45:56+00:00Added an answer on May 20, 2026 at 11:45 pm

    Have a look at this example

    DataTable dt = new DataTable();
    dt.Columns.AddRange(new[] { new DataColumn("ID", typeof(decimal)), new DataColumn("DepartmentID", typeof(decimal)) });
    
    for (int iRow = 0; iRow < 10 ; iRow++)
    {
        DataRow dr = dt.NewRow();
        dr["ID"] = iRow;
        dr["DepartmentID"] = iRow;
        dt.Rows.Add(dr);
    }
    dt.Columns.Add(new DataColumn("Test", typeof (decimal), "((ID + DepartmentID)*ID)"));
    

    Use the data visualizer before and after you add the last column (the calculated column).

    You will notice by adding the calculated column, the calculations are done for you.

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

Sidebar

Related Questions

I have this expression accordionMain_i0_accordion_i0_ctl01_0_ddl_xxxxxxxx_iy_tblItem where xxx can contain also '_' and its number
I have expression blend trial version 4.0.30816.0 and there is no intellisense for the
Is there a way to have Expression Language (EL) expressions included JavaScript files be
I have a expression: Select (2345789 * 39.456) / 100 The output is 925554.5078400
I have an expression with compound assignment as x += 2*5 so how it
I have an Expression<Func<T,DateTime>> I want to take the DateTime part of the expression
I have this expression: var result = from pav in ProductAttributes join id in
So far I have the expression: http://[^\.]*\.mydomain\.com/((.*?)) Which matches... http://www.mydomain.com/Images/favicon.ico But I really dont
I have a problem with a difficult regex. I have this expression to detect
In this program I am trying to make, I have an expression (such as

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.