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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:21:50+00:00 2026-06-17T19:21:50+00:00

Using the below mentioned query I am getting the all the values of a

  • 0

Using the below mentioned query I am getting the all the values of a column called
promotionValue . I want to get the sum of all the values of *matched *

var matched = from table1 in dvtempPropertyRoomRatePromotion.ToTable().AsEnumerable()
              join table2 in dvPropertyRooms.ToTable().AsEnumerable() on
              table1.Field<DateTime>("RateDate") equals table2.Field<DateTime>("RateDate")
            where table1.Field<DateTime>("RateDate") == table2.Field<DateTime>("RateDate")
               select table1.Field<string>("promotionValue");
  • 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-17T19:21:52+00:00Added an answer on June 17, 2026 at 7:21 pm

    You need to parse the string to int or decimal:

    var matched = from r1 in dvtempPropertyRoomRatePromotion.ToTable().AsEnumerable()
                  join r2 in dvPropertyRooms.ToTable().AsEnumerable() 
                  on r1.Field<DateTime>("RateDate").Date equals r2.Field<DateTime>("RateDate").Date
                  select decimal.Parse(r1.Field<string>("promotionValue"));
    decimal sum = matched.Sum();
    

    Note that i’ve also changed some other things like the redundant where (since you’ve already joined these tables) or the Date property of DateTime.

    Apart from that

    1. why do you need the DataView at all? ToTable creates always a new DataTable. Why don’t you use Linq-To-DataSet for all? I assume you’ve used the DataView for filtering, use Enumerable.Where instead. That would be more consistent, more efficient and more readable.
    2. why is the column promotionValue a string? You should store it as a numeric type.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using below mentioned query with about 400,000 records in each table its taking
i am using jqwidgets to bind the gird like mentioned below: var url =
Below mentioned is the way to get the element by Class Name var Tag
I'm using a thumbnail loader in my project the one mentioned below. The problem
I am using the HTML button tag but the style mentioned below should only
I am using List in C#. Code is as mentioned below: TestCase.cs public class
I am using below code to get profile image of friends using Resfb. I
I'm using below query to count the daily result, but now I'm make it
I tried using the example mentioned in below url. but got confused how they
Using the code below, I get the error, Call to undefined method stdClass::fetchObject() .

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.