Icon View Incident Report

Minor Minor
Reported By: Robin Joseph
Reported On: 4/8/2008
For: Version 1.09 Build 1
# 2598 Attempting to Insert an Empty String into a BLOB Column Causes a Null Exception in .NET Provider

Using VS2008, EDB 1.9.1 .Net

Cutting the procedure to a minimum - if I do the following, I receive the following exception at the DataCommand.ExecuteNonQuery():

Elevate.ElevateDB.Data.EDBException was unhandled
Message="Value cannot be null.\r\nParameter name: dest"
Source="Elevate.ElevateDB.Data"
ErrorCode=9999
ErrorColumn=0
ErrorLine=0
ErrorMsg=""
StackTrace:
at Elevate.ElevateDB.Data.EDBCommand.Execute()
at Elevate.ElevateDB.Data.EDBCommand.ExecuteNonQuery()
... other lines omitted...
InnerException: System.ArgumentNullException
Message="Value cannot be null.\r\nParameter name: dest"
Source="mscorlib"
ParamName="dest"
StackTrace:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex,
Array destinationArray, Int32 destinationIndex, Int32
length, Boolean reliable)
at System.Array.Copy(Array sourceArray, Int32 sourceIndex,
Array destinationArray, Int32 destinationIndex, Int32
length)
at edbcommon.TEDBMemoryStream.Write(Byte[] Buffer, Int32
Offset, Int32 Count)
at edbrow.TEDBStaticRowValueBlobMemoryStream.Write(Byte[]
Buffer, Int32 Offset, Int32 Count)
at edbrow.TEDBStaticRowValue.SetString(String Value)
at edbvalue.TEDBValue.SetAsString(String Value)
at edbvalue.TEDBValue.set_AsString(String Value)
at edbvalue.TEDBValue.Assign(TEDBPortableObject FromObject)
at edbrow.TEDBStaticRowValue.Assign(TEDBPortableObject
FromObject)
at edblocal.TEDBInsertManager.Execute()
at edblocal.TEDBLocalStatementManager.Execute()
at Elevate.ElevateDB.Data.EDBCommand.Execute()
InnerException:

At present, if the desc string is empty I change it to " " (single space) so I can work around it.

EDBCommand DataCommand = new EDBCommand();
DataCommand.Connection = new EDBConnection(EDBConnStr);
DataCommand.CommandType = CommandType.Text;
string desc = "";
DataCommand.CommandText = "INSERT INTO \"Treat\" (\"Treatment\") VALUES
('" + desc + "'")";  
     // Treatment column is a CLOB field, Nullable, Collation UNI
DataCommand.Connection.Open();
DataCommand.ExecuteNonQuery();
DataCommand.Connection.Close();
DataCommand.Connection.Dispose();
DataCommand.Dispose();



Comments Comments and Workarounds
The workaround is as-indicated by the customer.


Resolution Resolution
Fixed Problem on 4/9/2008 in version 1.09 build 2


Products Affected Products Affected
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial

Image