In my ASP.net C # web project, I have a request command object with parameters. I use the following code to populate 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 but empty lines. If I left the input field empty, it would pass the value as "". If this happens, I get the following exception:
ORA-01400: cannot insert NULL into (string)
Is there a way that allows me to insert empty rows into the database?
I am using an Oracle database and I am using System.Data.OracleClient as a provider.
source
share