passing Oracle Nulls in ADO.NET

C

Craig G

how do you pass a null into an oracle parameter?

i am doing the following which works fine when there is data to be passed in
but when the string is blank it wont accept "" or even as a system.dbnull

'Parameter for Address1

Dim parAddress1 As OracleClient.OracleParameter

parAddress1 = cmdInsert.Parameters.Add("strAddress1",
OracleClient.OracleType.VarChar)

parAddress1.Direction = ParameterDirection.Input



parAddress1.Value = Strings.UCase(strAddress1)



if have tried doing something like this

If strAddress1 = "" Then

parAddress1.Value = myDBNull (which is simply a variable as type
system.dbnull)

end if

but still no joy



Cheers,
Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top