Solved

OleDbDataAdapter.Update

Posted on 2016-08-26
3
39 Views
Last Modified: 2016-09-09
I'm using an OleDbDataAdapter.  When I call OleDbDataAdapter.Update, I don't see my changes in the database.    How do I debug this?  Where can I see the error code/info?
0
Comment
Question by:HLRosenberger
3 Comments
 
LVL 11

Accepted Solution

by:
CraigYellick earned 250 total points
Comment Utility
I routinely use the SQL Server Profiler to monitor what is actually sent from the client to the server. What is probably happening is that the UPDATE statement is valid (that is, does not throw any errors) but the WHERE condition is false so nothing actually gets updated. If the statement is based on a primary key, the parameter that provides the key value might be NULL, which would not throw an error but would not update anything.
0
 
LVL 20

Assisted Solution

by:ElrondCT
ElrondCT earned 250 total points
Comment Utility
The OleDbDataAdapter returns an integer for the number of rows updated. So

dim Result as Integer = OleDb1.Update(MySet)

will show you whether it's trying to send any information. I suspect Craig is right that there's something about the WHERE condition that's causing nothing to be sent, but this will confirm that.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
Comment Utility
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now