473,396 Members | 1,898 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,396 software developers and data experts.

Updating Oracle Datasets

I am having trouble setting the update command of my oracle adapter to the name of an Oracle
stored procedure. My data adapter is a global variable that I use in multiple functions.
But the following line of code

g_Da.UpdateCommand.CommandType = CommandType.StoredProcedur

Generates this error
System.NullReferenceException: Object reference not set to an instance of an object

Does anyone know why? Can someone tell me how I can successful set the update command of my
data adapter to my stored procedure

Thanks for your help

Parveen
Nov 20 '05 #1
19 1283
"Parveen" <an*******@discussions.microsoft.com> schrieb
I am having trouble setting the update command of my oracle adapter
to the name of an Oracle stored procedure. My data adapter is a
global variable that I use in multiple functions. But the following
line of code:

g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

Generates this error:
System.NullReferenceException: Object reference not set to an
instance of an object.

Does anyone know why? Can someone tell me how I can successful set
the update command of my data adapter to my stored procedure?


Either you didn't create a DataAdapter, or you didn't create an
UpdateCommand.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "=?Utf-8?B?UGFydmVlbg==?=" <an*******@discussions.microsoft.com> scripsit:
I am having trouble setting the update command of my oracle adapter to the name of an Oracle
stored procedure. My data adapter is a global variable that I use in multiple functions.
But the following line of code:

g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

Generates this error:
System.NullReferenceException: Object reference not set to an instance of an object.


Are you sure you assigned something to the 'UpdateCommand' property?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

Generates this error:
System.NullReferenceException: Object reference not set to an
instance of an object.


Are you sure you assigned something to the 'UpdateCommand'
property?

"yes, but it does not work:"

g_da.UpdateCommand = Something

--
Armin

Nov 20 '05 #4
Cor
Parveen, dont take attention to it, this is just about the word "something"

Hi Armin,
Are you sure you assigned something to the 'UpdateCommand'
property?


g_da.UpdateCommand = Something


I think this would be a very big error.

I would like it if there was in VB a statement as
If x Is Something (with an uppercase)

And therefore the message from Herfried with a lowercase is in my eyes very
correct.

:-))

Cor
Nov 20 '05 #5
"Cor" <no*@non.com> schrieb
Parveen, dont take attention to it, this is just about the word
"something"


Thx. :)

Are you sure you assigned something to the 'UpdateCommand'
property?


g_da.UpdateCommand = Something


I think this would be a very big error.

I would like it if there was in VB a statement as
If x Is Something (with an uppercase)

And therefore the message from Herfried with a lowercase is in my
eyes very correct.

:-))

:)

Won't there be the IsNot operator in the next version?

if x IsNot Nothing then
--
Armin

Nov 20 '05 #6
Cor
Hi Armin,

if x IsNot Nothing then


I am one of the few, but I hope not because this is also then possible

if Not x IsNot Nothing then

brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

I keep going in this newsgroup for

if x Is Something

Cor
Nov 20 '05 #7
"Cor" <no*@non.com> schrieb
Hi Armin,

if x IsNot Nothing then


I am one of the few, but I hope not because this is also then
possible

if Not x IsNot Nothing then

brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

I keep going in this newsgroup for

if x Is Something


But then this is also possible:

If not not x is something then

brrrrrrrr

;-)
--
Armin

Nov 20 '05 #8
Cor
Hi Parveen,

Probably you have only to add this line
g_Da = New OracledataAdapter
before line
g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

Or more probably put the new direct in your clobal g_Da something as
private g_DA as New OracledataAdapter

I hope this helps?

Cor
Nov 20 '05 #9
* "Armin Zingler" <az*******@freenet.de> scripsit:
I keep going in this newsgroup for

if x Is Something


But then this is also possible:

If not not x is something then


Why not both, 'Something' and 'IsNot':

\\\
If x IsNot Something Then...
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
* "Armin Zingler" <az*******@freenet.de> scripsit:
Won't there be the IsNot operator in the next version?

if x IsNot Nothing then


Yes.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #11
Cor
Hi Herfried,

I think because IsNot is again a new keyword.
And if you can avoid them you should do that.

(I know the answer Something is also new, but "something" is a natural word
and IsNot, if you have read something before from me, you know the rest of
my explanation)

Cor

Why not both, 'Something' and 'IsNot':

Nov 20 '05 #12
* "Cor" <no*@non.com> scripsit:
I think because IsNot is again a new keyword.
And if you can avoid them you should do that.
Mhm... I like new keywords if they make sense.
(I know the answer Something is also new, but "something" is a natural word
and IsNot, if you have read something before from me, you know the rest of
my explanation)


Yep -- I would prefer 'Something' too.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
Ok...so what do you guys mean when you ask me if I set my UpdateCommand to something?

Wasn't I doing that when I did....

g_Da.UpdateCommand.CommandText = "PCD_HRLY_CODE_ENF_Update"
g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

The project's blowing up on the first line...do u guys know how i can fix this or can you explain
what you meant by your advice earlier?

Hope I won't cause another controversy!! ;)

Parveen
Nov 20 '05 #14
Cor
Hi Parveen,

This was an Off Thread discussion not about the message itself, but about
the answer.
At the start of this OT I did wrote that this was not about your problem.

I did gave an answer before I did that so have a look at that.

But in this newsgroups is Oracle never a topic.

If my answer does not fit you can try it in the newsgroup

Microsoft.public.dotnet.framework.adonet

There is Miha active, with him you have the best change for Oracle problems
I think.

Cor
g_Da.UpdateCommand.CommandText = "PCD_HRLY_CODE_ENF_Update"
g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure

The project's blowing up on the first line...do u guys know how i can fix this or can you explain what you meant by your advice earlier?

Nov 20 '05 #15
I get past that error message if I add the following line of code before doing anything with the update statement:

myDa.UpdateCommand = New OracleCommand

Thanks for your advice....it led me in the right direction!!
Nov 20 '05 #16
Yes I know that it was an off thread discussion...and you did mention that...which is totally fine with me
Nov 20 '05 #17
* "=?Utf-8?B?UGFydmVlbg==?=" <an*******@discussions.microsoft.com> scripsit:
Ok...so what do you guys mean when you ask me if I set my UpdateCommand to something?

Wasn't I doing that when I did....

g_Da.UpdateCommand.CommandText = "PCD_HRLY_CODE_ENF_Update"
g_Da.UpdateCommand.CommandType = CommandType.StoredProcedure


What result to you get if you run this code before the 1st line?

\\\
MsgBox((g_Da Is Nothing).ToString())
MsgBox((g_Da.UpdateCommand Is Nothing).ToString())
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #18
Herfreid,
It works when I insert the following line of code before doing anything with the UpdateCommand:

myDa.UpdateCommand = New OracleCommand

Thanks for your help! :)

Parveen

Nov 20 '05 #19
* "=?Utf-8?B?UGFydmVlbg==?=" <an*******@discussions.microsoft.com> scripsit:
It works when I insert the following line of code before doing anything with the UpdateCommand:

myDa.UpdateCommand = New OracleCommand


That's what I expected.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #20

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

Similar topics

7
by: Tim Smith | last post by:
Hi, Is it possible to create a progam to mimic the following action a) drag oledbadapter to form1.cs b) select my oracle ole connection c) enter 'select * from mytable' d) create adapter for...
4
by: Mateusz [PEYN] Adamus | last post by:
Hi all! Is it possible to join for example Oracle and MS SQL tables in one dataSet and show it in one dataGrid? I'm writing in C# and using standard ADO components that come with .NET...
6
by: Mike Wilson | last post by:
Dear Group, I have a heirarchical set of database tables, say - "order" and "order_type" and want to display a series of orders in a grid control, and in place of the order_type foreign key...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
13
by: mfreeman | last post by:
The minimal code (VB.NET 2003) needed to show this problem is shown below. All I do is loop through the records in the table and update them without making any changes. Out of 600 records, about...
0
by: OldStd | last post by:
Updating data using 2 data sets I am having some problems in updating the database using two datasets as suggested by someone. 1. Data is displayed in a data grid from a dataset generated using...
1
by: Evan M. | last post by:
Hello, I'm creating a web app that needs to provide some simple, read-only access to an Oracle database using SELECT statements. What I am curious about is which provider...
7
by: Peter Hann | last post by:
As far as I know VisualStudio contains a MS built-in data provider for accessing Oracle databases. Is this built-in MS data provider only in the "full" VisualStudio Edition or in the Express...
23
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.