Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

Sending dataBind data from a textbox to an Acess DB

What I have done is created a "customer screen" with all kinds of textboxes and using:

custFName.DataBindings.Add("Text",dsCustomer1,"Customer.customerFirstName");

dsCustomer1 being my dataset and "Customer.customerFirstname" being my data member in the DB

I have the form loading ok and my navagation is great but I cannot send the infomation back to the Acess DB

The code i am using is as follows:
if (dsCustomer1.HasChanges())
                  {
                        DataSet dsNew = new DataSet();
                        dsCustomer1.AcceptChanges();
                        dsCustomer1.Merge(dsNew);
                        adapterCustomer.Update(dsCustomer1);
                        MessageBox.Show("Updated");
                        BindData(); // I use this to reload the ds
                  }
                  else
                  {
                        MessageBox.Show("Nothing to Save");
                  }


can anyone help me?
0
Socrates2k1
Asked:
Socrates2k1
1 Solution
 
nayernaguibCommented:
Try following code:

if (dsCustomer1.HasChanges())
               {
                    adapterCustomer.Update(dsCustomer1);
                    dsCustomer1.AcceptChanges();
                    MessageBox.Show("Updated");
                    BindData(); // I use this to reload the ds
               }
               else
               {
                    MessageBox.Show("Nothing to Save");
               }

_________________

  Nayer Naguib
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now