I see this error
Update requires valid UpdateCommand passed DataRow collection modified rows.
When I run the following code. But the strange thing is that I have similar code on another form and it works great. The only difference is the database table is different. I verified both tables and they look identical, as far as settings. I have verified that _Non_MS_Office_Licenses has a primary key that is unique. Looking in dataset manager I see the query for fillBy() is fine and it has all the insert and update stuff. At the end when it verifies it says all is verified when I configure the dataset
Code:Dim row = FrmApp.Non_MS_Office_LicensesBindingSource.Current row("Primary User") = Replace(CStr(TxtUserid.Text), "'", "`") row("Staff Last Name") = Replace(CStr(TxtLastName.Text), "'", "`") row("Staff First Name") = Replace(CStr(TxtFirstName.Text), "'", "`") row("CI Name") = Replace(CStr(TxtTitle.Text), "'", "`") row("Version") = Replace(CStr(TxtVersion.Text), "'", "`") row("New/Upgrade") = Replace(CStr(CmboNewUgd.SelectedItem), "'", "`") row("PO Number") = Replace(CStr(TxtPONumber.Text), "'", "`") row("PCard") = CBool(PCard) row("Company") = Replace(CStr(TxtSoftwareCo.Text), "'", "`") row("Invoice Date") = Replace(CStr(TxtInvDate.Text), "'", "`") row("Invoice Number") = Replace(CStr(TxtInvNumber.Text), "'", "`") row("Serial/License/Keycode") = Replace(CStr(TxtSerial.Text), "'", "`") row("Department") = Replace(CStr(CmbDept.SelectedItem), "'", "`") row("Server") = CStr(CmboServer.SelectedItem) row("Assigned Date") = Replace(CDate(TxtAssignedDate.Text), "'", "`") If TxtComment.Text.Length > 1 Then row("Working Notes") = Replace(CStr(TxtComment.Text), "'", "`") Else row("Working Notes") = DBNull.Value End If row("Type of License") = CStr(CmboLicType.SelectedItem) row("CI Subtype") = CStr(CmboSubType.SelectedItem) row("Division") = Replace(CStr(TxtDivision.Text), "'", "`") ' row("CI Type") = "Software Application" FrmApp.Non_MS_Office_LicensesBindingSource.EndEdit() intTotalChanges = FrmApp.Non_MS_Office_LicensesTableAdapter.Update(FrmApp.SoftwareDataSet._Non_MS_Office_Licenses)




Reply With Quote