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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:32:00+00:00 2026-05-27T04:32:00+00:00

maybe I need to start over. Thx for the helpful links for the datagridview

  • 0

maybe I need to start over. Thx for the helpful links for the datagridview but I didn’t really need to bring that up.

The essence of the problem is this: I use this method for 2 things:
– to get the necessary data out of the database when adding a new record
– to get the necessary data out of the database after I’ve updated a record

public void refreshReservationDetail()
{
    _oReservationDetail = (from rd in _oReservation.tblReservationDetails
                           where rd.ReservationID == _oReservationObject.ID
                           select rd).ToList();
}

When I add a new record the new data is saved and loaded into the datagridview. So this works fine.

When I update an existing record (that is already shown in the datagridview) the altered content is also being saved properly but the method above is not giving me the saved data but still the old data. How come?

Here I save my data

//frmReservationDetail
public event dRefresh SavedActivity;

private void btnOk_Click(object sender, EventArgs e)
{
    _oReservationDetail.ReservationDetailData.ReservationID = _oReservationDetail.ReservationObjectData.ID;
    _oReservationDetail.ReservationDetailData.StartTime = Convert.ToDateTime(_oReservationDetail.ReservationObjectData.StartTime.Value.ToString("dd/MM/yyyy") + " " + _oDateTime[cboStartTime.getSelectedID()]);
    _oReservationDetail.ReservationDetailData.EndTime = Convert.ToDateTime(_oReservationDetail.ReservationObjectData.StartTime.Value.ToString("dd/MM/yyyy") + " " + _oDateTime[cboEndTime.getSelectedID()]);
    if (this.cboLanguage.SelectedItem != null)
    {
        _oReservationDetail.ReservationDetailData.LanguageID = this.cboLanguage.getSelectedID();
    }
    else
        _oReservationDetail.ReservationDetailData.LanguageID = null;

    if (this.cboTargetgroup.SelectedItem != null)
    {
        _oReservationDetail.ReservationDetailData.TargetgroupID = this.cboTargetgroup.getSelectedID();
    }
    else
        _oReservationDetail.ReservationDetailData.TargetgroupID = null;

    if (this.cboExcursion.SelectedItem != null)
    {
        _oReservationDetail.ReservationDetailData.ExcursionID = this.cboExcursion.getSelectedID();
    }
    else
        _oReservationDetail.ReservationDetailData.ExcursionID = null;

    _oReservationDetail.ReservationDetailData.Participants = int.Parse(this.txtParticipants.Text);
    _oReservationDetail.ReservationDetailData.Leaders = int.Parse(this.txtLeaders.Text);
    _oReservationDetail.ReservationDetailData.Remarks = this.txtRemarks.Text;
    _oReservationDetail.save();

    if(SavedActivity != null)
        SavedActivity();

    this.Close();
    }

//clsReservationDetail
public void save()
{
    int i = _oReservationDetail.ID;
    if (_oReservationDetail.ID == 0)
    {
            _oReservation.tblReservationDetails.InsertOnSubmit(_oReservationDetail);
            _oReservation.SubmitChanges();
    }
    _oReservation.SubmitChanges();
}
  • 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-27T04:32:01+00:00Added an answer on May 27, 2026 at 4:32 am

    It sounds like you aren’t rebinding your datagridview. After you save/update you should be calling refreshReservationDetail() again, and then you’ll need to once again set the datasource to that variable and rebind it. If you are doing this asynchronously with an update panel or some such, you’ll have to call refreshReservationDetail() at the end of the event that is fired for saving/updating. If the page is posting back normally then just make sure your databinding to the gridview occurs regardless if it’s a postback or not.

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

Sidebar

Related Questions

Maybe the need to do this is a 'design smell' but thinking about another
Maybe I am just over thinking this and need to write some more prototype
Maybe this sounds a little bit crazy, but I need to come up with
I have a table that contains maybe 10k to 100k rows and I need
I haven't actually done this yet, and maybe I don't need to, but it
I maybe need to do a project in Delphi and are a beginner in
I need to pause for maybe 500 miliseconds before I submit a form. Here
I need to store various info about some movies, books, games, and maybe other
Very direct question, i need to know if its possible and maybe where to
How can I prepare the configuration settings (App.config, maybe?) I need to use Enterprise

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.