In my ASP.net C# web project I have a query command object that has parameters. I use the following code to fill the parameters:
DbCommand command = conn.CreateCommand();
command.CommandText = query;
DbParameter param = command.CreateParameter();
param.ParameterName = parameter;
param.DbType = DbType.String;
param.Value = value;
This code works for all strings except for empty ones. If I would leave an input field blank, it would pass the value as "". If this happens I receive the following exception:
ORA-01400: cannot insert NULL into (string)
Is there a way that would allow me to insert blank strings into the database?
I use an Oracle database and I'm using System.Data.OracleClient as provider.