Newbie Missing Something with Access DB Update Using VB .NET

P

pooba53

I have a VB .NET application that is communicating properly with an
Access DB. I have a slew of textbox controls bound to a dataset and
when the application launches, the fields are correctly populated.

If someone changes a value in one of the text boxes, I need to have a
button capture the change and commit the update to Access. I know I'm
close, but something is missing. I have a data adapter called:
OleDbDataAdapter1

and a dataset called:
DsMyMonthlyIncome1

My button function is:
Try
OleDbDataAdapter1.Update(DsMyMonthlyIncome1)

Catch ex As Exception
MsgBox(ex.ToString)
End Try

No error occurs, but the changed information in the text field never
gets communicated to the Access DB. Have I not captured the changes by
having the textbox controls bound?

I've searched quite a bit today, and not found the information I seek.
I am lost here and appreciate the help.
 
R

RobinS

When they change the entry, you need to do an EndEdit()
on the BindingSource (if you're using one) or whatever the
data source is in order to save the changes to the dataset.
Once you do that, the changes will be there to be propagated
back to the database using the Update command.

Robin S.
 
P

pooba53

I'm afraid as a newbie, I don't quite understand what you mean. The
data is modified in a textbox. The way I bound the textboxes to their
Access counterparts was to within the textbox properties, choose
(Databindings)->Text->DsMyMonthlyIncome1 - Budget Items.My Monthly Net
Income as an example.

So what item do I call the EndEdit() on? Keep in mind, this is not a
datagrid, but a textbox.

I sure appreciate the help.
-Dan
 
P

pooba53

Can anyone help me out here?
Thanks.

I'm afraid as a newbie, I don't quite understand what you mean. The
data is modified in a textbox. The way I bound the textboxes to their
Access counterparts was to within the textbox properties, choose
(Databindings)->Text->DsMyMonthlyIncome1 - Budget Items.My Monthly Net
Income as an example.

So what item do I call the EndEdit() on? Keep in mind, this is not a
datagrid, but a textbox.

I sure appreciate the help.
-Dan
 
R

RobinS

Are you doing VB2003 or VB2005?

Robin S.

I'm afraid as a newbie, I don't quite understand what you mean. The
data is modified in a textbox. The way I bound the textboxes to their
Access counterparts was to within the textbox properties, choose
(Databindings)->Text->DsMyMonthlyIncome1 - Budget Items.My Monthly Net
Income as an example.

So what item do I call the EndEdit() on? Keep in mind, this is not a
datagrid, but a textbox.

I sure appreciate the help.
-Dan
 
R

RobinS

I don't know how to help you. I use the BindingSource in VB2005,
which is responsible for pushing the data from the controls down
into the underlying datasource. I think the BindingSource component
was new in .Net2.0. Since I went from VB6 to VB2005, I never used
the 2003 version.

I recommend that you repost your question to
microsoft.public.dotnet.languages.vb and/or
microsoft.public.dotnet.framework.windowsforms.databinding

and specify that you have VB2003. Someone will probably pop up
and help you.

Note that if you post to both groups (and I would), post both of
them at once, so it is cross-posted, and if someone answers in
one group, the answer will show up in both groups.

Sorry I couldn't help you more.
Robin S.
-------------------------
 
R

RobinS

I saw your posting in the other newsgroup. You might want to post
an addendum to it stating that you have VB2003 and not VB2005.
Just FYI. Good luck.
Robin S.
---------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top