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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:27:35+00:00 2026-06-07T21:27:35+00:00

Here is the child form: Here’s the code behind it: public partial class uxFormDatabase

  • 0

Here is the child form:

enter image description here

Here’s the code behind it:

public partial class uxFormDatabase : Form 
{ 

BindingSource rawtableBindingSource = null; 

public uxFormDatabase(BindingSource myPassedSource)  
{ 
    InitializeComponent(); 
    rawtableBindingSource = myPassedSource; 

    uxDGVtable.AutoSize = true; 
    dataToDGV(); 
} 

public void dataToDGV() 
{ 
    uxrawdataBindingNavigator.BindingSource = this.rawtableBindingSource; 
    uxDGVtable.DataSource = this.rawtableBindingSource; 
} 

private void saveToolStripButton_Click(object sender, EventArgs e) 
{ 
    Validate(); 
    rawtableBindingSource.EndEdit(); 
} 

} 

I was under the impression that when uxFormDatabase is activated the method public uxFormDatabase(BindingSource myPassedSource) fires which passes the BindingSource in from the parent form;

If that is the case then why when I press the save button ‘saveToolStripButton_Click’, on the BindingNavigator are the changes not getting saved back to the database? Do these two lines not save changes back to the databse Validate();rawtableBindingSource.EndEdit(); ?

UPDATE

The above form is loaded from this parent form:

namespace WindFormAppRevisionHelper
{

    public partial class uxRevisionHelperForm : Form
    {

        public SqlCeConnection conn = null;
        public SqlCeDataAdapter da = null;
        public DataSet ds = null;
        BindingSource definitionsBindingSource = new BindingSource();

    public uxRevisionHelperForm()
    {
        InitializeComponent();
        uxDescriptionTextBox.AutoSize = true;
        refreshBindingSource();
        assignControlsToSource();
    }

    public void refreshBindingSource()
    {            
        conn = new SqlCeConnection(ConfigurationManager.ConnectionStrings["WindFormAppRevisionHelper.Properties.Settings.DefinitionsDBConnectionString"].ConnectionString);
        da = new SqlCeDataAdapter(new SqlCeCommand("Select * From tb_RevisionDefinitions",conn));
        ds = new DataSet("Study Helper");
        ds.Tables.Add("DefinitionsTable");
        da.Fill(ds.Tables["DefinitionsTable"]);

        // Assign the BindingSource.
        definitionsBindingSource.DataSource = ds.Tables["DefinitionsTable"];
        uxBindingNavigator.BindingSource = this.definitionsBindingSource;

    }
    void assignControlsToSource() 
    {
        uxDescriptionTextBox.DataBindings.Add(new Binding("Text", definitionsBindingSource, "Description", true));
        uxWordPhraseTextBox.DataBindings.Add(new Binding("Text", definitionsBindingSource, "WordPhrase", true));
        uxReferenceTextBox.DataBindings.Add(new Binding("Text", definitionsBindingSource, "Reference", true));
    }

    private void uxUpdateDataButton_Click(object sender, EventArgs e)   
    {
        uxRevisionHelperGroupBox.Enabled = false;
        uxBindingNavigator.Hide();
        uxFormDatabase myNewDisplay = new uxFormDatabase(definitionsBindingSource);//<<<<this loads the _child_ form
        myNewDisplay.FormClosed += delegate { activateGroupBorder(); };
        myNewDisplay.Show();    
    }

    public void activateGroupBorder() 
    {
        uxRevisionHelperGroupBox.Enabled = true;
        uxBindingNavigator.Show();
    }
}
  • 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-07T21:27:37+00:00Added an answer on June 7, 2026 at 9:27 pm

    If you look at this example you can see that, the SqlDataAdapter object used to prepare the binding source, is responsible of the database update.

    I think you could pass to the constructor of your uxFormDatabase also the SqlCeDataAdapter da, save it in a global instance var inside your uxFormDatabase and then, after the Validate and EndEdit, call da.Update((DataTable)rawtableBindingSource.DataSource);

    Code used:

        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            Validate();
            rawtableBindingSource.EndEdit();
            SqlCeCommandBuilder cmdBuilder = new SqlCeCommandBuilder(rawtableDA);
            rawtableDA.Update((DataTable)rawtableBindingSource.DataSource);
            cmdBuilder = null;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a parent form first.cs like this public partial class first : Form
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
I am adding the LinearLayout(child view) to another LinearLayout(parentview) programatically here I want to
So, here is the function for pre-filtering CHILD: function(match){ if ( match[1] === nth
My HTML: <div id="parent"> <div id="child">cx</div> </div> When I use jQuery $('#parent').mouseout(function(){ //something here
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
I have 2 forms ParentForm and a child form. In my parent form I
Here is a function from raislcasts.com complex-form-examples about dynamically adding field to form. 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.