Solved

OleDbDataAdapter.Update

Posted on 2016-08-26
3
60 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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