473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DataAdapter not updating

Hello,

On a form I have 3 textboxes, txt0, txt1, txt2 which
contain all integers. I have also placed a connection
component (conn), dataadapter component (da1) and dataset
component (ds1) from the toolbox on to the form. I
established a connection to an Access mdb file and can
display data correctly on the form in the textboxes. The
textboxes are bound to columns in the dataset. So the
only code I have to populate the form is on the Form_Load
event

ds1.Clear
da1.Fill(ds1, "tbl1")

This works fine. But if I change/modify the data in one
of the textboxes and execute

da1.Update(ds1, "tbl1")

the data does not get updated in Access. I have tried
populating the parameters for the
da1.UpdateCommand.Parameters collection

da1.UpdateCommand.Parameters("fld1").Value = txt1.text

(while I'm at it, the above line didn't work either -
problem casting text to int - how to do that properly?)
so I did the following:

da1.UpdateCommand.Parameters("fld1").Value = 1234
da1.Update(ds1, "tbl1")

but this did not update tbl1 either. How do I make the
dataAdapter work to update?

Thanks,
Rich


Nov 20 '05 #1
2 1348
Cor
Hi Rich,

Can be anything but this is the first thing to try before your dataadapte
update
(If it is a databinded textbox)

BindingContext(ds1t, "tbl1").EndCurrentEdit()

da1.Update(ds1, "tbl1")


I hope this helps,

Cor
Nov 20 '05 #2
Thanks. I am guessing that would go like this?
....
BindingContext(ds1, "tbl1").EndCurrentEdit()
da1.Update(ds1, "tbl1")
End Sub

I will give that a try.

Thanks again,
Rich

-----Original Message-----
Hi Rich,

Can be anything but this is the first thing to try before your dataadapteupdate
(If it is a databinded textbox)

BindingContext(ds1t, "tbl1").EndCurrentEdit()

da1.Update(ds1, "tbl1")


I hope this helps,

Cor
.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ms.net | last post by:
I am having problem updating data with dataadapter....in some of my tables. I realize that, Dataadapter doesn't SOMETIME fire event rowupdating even if there are new rows. Because of that,rows...
1
by: Ms.net | last post by:
am having problem updating data with dataadapter....in some of my tables. I realize that, Dataadapter doesn't SOMETIME fire event rowupdating even if there are new rows. Because of that,rows...
2
by: Ruslan Shlain | last post by:
Is there a way to tell DataAdapter to continue updating if it encounters error. So, in other words once it starts to update records in the database and it fails on one of them, then it would...
13
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an...
3
by: RSH | last post by:
Hi, I have a situation in where i have two instances of SQL server, the first is our Production Environment, the second is our Development environment. Both servers contain the same databases...
2
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
6
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection =...
5
by: George | last post by:
I have set DataAdapter.AcceptChangesDuringUpdate = true; However, I find that I still need to call AcceptChanges on the associated DataTable, DataTable.AcceptChanges(); Has anyone...
2
by: mfleet1973 | last post by:
Hi Gang. I'm using VB.Net 2003. In the following code I'm updating the dataadapter with a new record added to the table: OleDbDataAdapter1.Update(DataSet11.GetChanges, "Table") However,...
3
by: Rich | last post by:
What is the diffeence bewtween a dataAdapter.InsertCommand and dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)? Dim da As SqlDataAdapter conn.Open da.SelectCommand =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.