Solved

OleDbDataAdapter.Update

Posted on 2016-08-26
3
57 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
ID: 41772090
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
ID: 41776705
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
ID: 41791493
Thanks!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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