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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:48:22+00:00 2026-06-03T22:48:22+00:00

The above error message appears when I am trying to get Column Value from

  • 0

The above error message appears when I am trying to get Column Value from Datatable.

This is what I find in the stacktrace:

System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1
source)

 and this in the TargetSite when debugging:

{ Boolean b__0(System.Data.DataRow)}

Here is my code:
DataTable hr = new DataTable();

            hr.Columns.Add("BookingDate");
            hr.Columns.Add("BookingId");
            hr.Columns.Add("BookingSource");
            hr.Columns.Add("CheckInDate");
            hr.Columns.Add("CheckOutDate");


            for (int i = 0; i < gmisc.GetModifiedBookings(gmoreq).Bookings.Length; i++)
            {
                hr.Rows.Add();
                hr.Rows[i]["BookingDate"] = Convert.ToDateTime(gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingDate.ToString());
                hr.Rows[i]["BookingId"] = Convert.ToInt64(gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingId.ToString());
                hr.Rows[i]["BookingSource"] = gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingSource.ToString();
                hr.Rows[i]["CheckInDate"] = Convert.ToDateTime(gmisc.GetModifiedBookings(gmoreq).Bookings[i].CheckInDate.ToString());
                hr.Rows[i]["CheckOutDate"] = Convert.ToDateTime(gmisc.GetModifiedBookings(gmoreq).Bookings[i].CheckOutDate.ToString());



            }
            Int64 BookingId = (from DataRow dr in hr.Rows
                          where (Int64)dr["BookingId"] == BookId
                          select (Int64)dr["BookingId"]).FirstOrDefault();
                TextBox1.Text = Convert.ToString(BookingId);

Where did I go wrong, if somebody can please tell me.

  • 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-03T22:48:23+00:00Added an answer on June 3, 2026 at 10:48 pm

    Check your code, the very first two lines:

    hr.Rows[i]["BookingDate"] = Convert.ToDateTime(gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingDate.ToString());
    hr.Rows[i]["BookingId"] = Convert.ToInt64(gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingId.ToString());
    

    if gmisc.GetModifiedBookings(gmoreq).Bookings[i].BookingDate is null then ???
    you are trying to convert it into string and then to datetime

    if null then .ToString will give error “Specified cost…….”

    and same will happen at the time of converting to datetime.

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

Sidebar

Related Questions

I get the above error message (which I googled and found is something to
Debug from IE Line: 2 Character: 580 Code: 0 Error Message: Unable to get
I seem to be getting the above error when trying to make a callable
Google reveals no posts at all for this error message. I'm getting it in
I get the following IDE error which appears inline or on the package declaration
Getting the above error in following code. How to rectify it. Thanks. Please look
I am getting the above error in my VS 2008 C# method when I
I have no code behind and the above error keep prompting on INSERT. The
i am declaring cg-point or rect as const it giving above error any one
About three hours ago I started seeing the above error in my production server.

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.