|
-
Oct 22nd, 2002, 04:39 AM
#1
Thread Starter
Fanatic Member
Dataset will not update???
I have a dataset on a winform created with the following code:
Dim objConnection As New OleDb.OleDbConnection(CONNSTRING)
Dim objOwnerDA As New OleDb.OleDbDataAdapter("Select * from tblItems", objConnection)
Dim objOwnerCB As New OleDb.OleDbCommandBuilder(objOwnerDA)
Dim objdataset As New DataSet()
objdataset.Clear()
objOwnerDA.FillSchema(objdataset, SchemaType.Source, "tblItems")
objOwnerDA.Fill(objdataset, "tblItems")
daCust.Fill(dsCust, "tblClients")
I have a button on my form which updates the dataset:
objOwnerDA.Update(objdataset, "tblItems")
For some reason the update does not reflect the changes made to the dataset on the form.
Any Ideas?
I use a combo to search for records with the following code. Could this be interfering in some way?:
Dim i As Integer, strCurrentID As String
For i = 1 To objdataset.Tables("tblItems").Rows.Count
ComboBox2.DisplayMember = objdataset.Tables("tblItems").Rows(i - 1).Item("itemDescription")
strCurrentID = objdataset.Tables("tblItems").Rows(i - 1).Item("itemDescription")
ComboBox2.Items.Add(strCurrentID)
Next
ComboBox2.SelectedIndex = 0
FillOwnerDetails()
Thanks in Advance
-
Oct 22nd, 2002, 02:04 PM
#2
New Member
objOwnerDA needs an updatecommand to update data.
-
Oct 23rd, 2002, 09:30 PM
#3
Registered User
If you are using SQL server then check out the command builder object which you need to use as it creates the sql on the fly for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|