473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Ole DB Update failing

I have code which creates a DataAdapter, and upddate command etc, and then
finally does and update which fails. The error message which is returned is
"Object Reference not set to an instance of an object."

The update SQL is "Update Leads set Company_Name = ? where LeadId = ?"

If I change it to: "Update Leads set Company_Name = ? where LeadID = 5" no
error is thrown and the record is updated.

The first thought of course is that there is a missing update parameter, but
looking in the debugger shows that there are two update parameters, and that
the second one looks just like it should, including having an appropriate
value.

Yet when the update occurs, the error is thrown. This is the the stack at
the time of the error:

An exception of type System.NullReferenceException occured at 7/4/2005
7:59:13 PM
Message:Object reference not set to an instance of an object.

Method:Int32 Update(System.Data.DataRow[],
System.Data.Common.DataTableMapping)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at Avasoft.Leads.LeadsListingSave(CDataSet oDataSet) in
c:\greg\clients\pwhite\blm non vss\blm00\dataaccess\leads.cs:line 188
at Avasoft.LeadsListingBiz.LeadsListingSave(CDataSet oDataSet) in
c:\greg\clients\pwhite\blm non vss\blm00\business\leadslistingbiz.cs:line 27
at Avasoft.LeadViewForm.button1_Click(Object sender, EventArgs e) in
c:\greg\clients\pwhite\blm non vss\blm00\appmain\leadviewform.cs:line 305
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMethods+IMsoComponentManager. FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Avasoft.AppMain.RunApp() in C:\Greg\Clients\PWhite\BLM non
VSS\BLM00\AppMain\AppMain.cs:line 84
at Avasoft.AppMain.DoApp() in C:\Greg\Clients\PWhite\BLM non
VSS\BLM00\AppMain\AppMain.cs:line 47

Any insight into what is occuring would be greatly appreciated - I have
spent about 10 hours on this to no avail, done a Google search, looked
through help files, refactored etc. Thanks.

--
Greg Gum
Nov 17 '05 #1
1 1841
This was resolved by re-installing the OleDB driver. Makes no sense, but
it's working now.

--
Greg Gum
"Greg" wrote:
I have code which creates a DataAdapter, and upddate command etc, and then
finally does and update which fails. The error message which is returned is
"Object Reference not set to an instance of an object."

The update SQL is "Update Leads set Company_Name = ? where LeadId = ?"

If I change it to: "Update Leads set Company_Name = ? where LeadID = 5" no
error is thrown and the record is updated.

The first thought of course is that there is a missing update parameter, but
looking in the debugger shows that there are two update parameters, and that
the second one looks just like it should, including having an appropriate
value.

Yet when the update occurs, the error is thrown. This is the the stack at
the time of the error:

An exception of type System.NullReferenceException occured at 7/4/2005
7:59:13 PM
Message:Object reference not set to an instance of an object.

Method:Int32 Update(System.Data.DataRow[],
System.Data.Common.DataTableMapping)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at Avasoft.Leads.LeadsListingSave(CDataSet oDataSet) in
c:\greg\clients\pwhite\blm non vss\blm00\dataaccess\leads.cs:line 188
at Avasoft.LeadsListingBiz.LeadsListingSave(CDataSet oDataSet) in
c:\greg\clients\pwhite\blm non vss\blm00\business\leadslistingbiz.cs:line 27
at Avasoft.LeadViewForm.button1_Click(Object sender, EventArgs e) in
c:\greg\clients\pwhite\blm non vss\blm00\appmain\leadviewform.cs:line 305
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMethods+IMsoComponentManager. FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Avasoft.AppMain.RunApp() in C:\Greg\Clients\PWhite\BLM non
VSS\BLM00\AppMain\AppMain.cs:line 84
at Avasoft.AppMain.DoApp() in C:\Greg\Clients\PWhite\BLM non
VSS\BLM00\AppMain\AppMain.cs:line 47

Any insight into what is occuring would be greatly appreciated - I have
spent about 10 hours on this to no avail, done a Google search, looked
through help files, refactored etc. Thanks.

--
Greg Gum

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

198
by: Michael N. Christoff | last post by:
Java, the software developed by Sun Microsystems in the mid-1990s as a universal operating system for Internet applications, gave NASA a low-cost and easy-to-use option for running Spirit, the...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
2
by: ksedran | last post by:
I am having a "not all variables bound" issue when trying to delete a row from a datagrid. I have a datagrid populated with data from a oracle table as follows: da = New...
18
by: Scott David Daniels | last post by:
There has been a bit of discussion about a way of providing test cases in a test suite that _should_ work but don't. One of the rules has been the test suite should be runnable and silent at every...
0
by: EggNChips | last post by:
Hi, trying to update a BLOB column using SQLParamData / SQLPutData and it all works fine until the BLOB is > ~700KB. I'm putting it in 1KB chunks, but I have also tried 2KB without success. ...
0
by: a_rajanikanth | last post by:
Hi, The following is the trigger which is failing when executing. Can you please tell me the reason why it is failing ? Trigger got created but throwing exception. CREATE TRIGGER TOBJ_U...
2
by: andy6 | last post by:
I am using the following code and SQL Profiler shows no activity when I step through the .update line. Do you see a syntax error? Thanks! using (SqlConnection cn = new SqlConnection(cnStr)) {...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
0
NeoPa
by: NeoPa | last post by:
Introduction : I have come across a problem, on a number of occasions, where PCs under my control fail to load new updates successfully. This is true whether they are attempting to apply via the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.