Pass Null value for Number field in PL/SQL from C#

ASPDEV used Ask the Experts™
Hello Experts,

I have a issue while inserting null into oracle database from .NET application. I have a field Phone  which is number in database, but want to insert null  when it's passed as parameter value and from application I also need to format the data(string value) and remove any symbols and insert just number.

E.g. 123-456-7890 should be 1234567890
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
If you aren't using ODP.Net as your data provider, you need to be.  The new Managed Client doesn't require any client install.

You can get it here:

To get a null, use DBNull.Value as the parameter value:

As for formatting your string, that should be left to the .Net code.  Should be a simple regex replace?

Quick example here:


Thanks, it works.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial