I am getting data overflow exceptions even though the column is more than big enough for the value.
I have the following table created in Sybase ASE Developer Edition:
create table resource (
id numeric(38,0) identity ,
resource_type varchar(255) not null ,
version numeric(19,0) not null ,
amount numeric(38,22) null ,
section_question_id numeric(19,0) null ,
resource_profile_id numeric(19,0) null ,
self_assessment_id numeric(19,0) null ,
unit_id numeric(19,0) null ,
unit_name varchar(40) null ,
energy numeric(38,22) null ,
indicative_c02 numeric(38,22) null ,
energy_factor numeric(21,11) null ,
indicative_c02_factor numeric(21,11) null ,
other_section_id numeric(19,0) null ,
other_energy_source varchar(100) null ,
custom_q_order int null
)
I have an EntityCollection populated, have modified the contents of the "amount" field and am trying to save using this code:
EntityCollection<ResourceEntity> resources = GetResources();
try
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.SaveEntityCollection(resources, false, false);
}
}
catch (Exception e)
{}
I get this exception caught by the above catch block:
SD.LLBLGen.Pro.ORMSupportClasses.ORMException = "An exception was caught during the execution of an action query: Data overflow. Increase specified column size or buffer size. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."
The following output is generated:
Method Enter: CreateUpdateDQ(4)
Method Enter: CreateSingleTargetUpdateDQ(4)
Generated Sql query:
Query: UPDATE devdb.dbo.resource SET amount=@Amount WHERE ( devdb.dbo.erep_resource.id = @Id1)
Parameter: @Amount : Decimal. Length: 38. Precision: 38. Scale: 22. Direction: Input. Value: 1.
Parameter: @Id1 : VarNumeric. Length: 38. Precision: 38. Scale: 0. Direction: Input. Value: 1299.
Method Exit: CreateSingleTargetUpdateDQ(4)
Method Exit: CreateUpdateDQ(4)
Method Enter: DataAccessAdapterBase.ExecuteActionQuery
Method Enter: DataAccessAdapterBase.OpenConnection
Method Exit: DataAccessAdapterBase.OpenConnection
A first chance exception of type 'Sybase.Data.AseClient.AseException' occurred in Sybase.Data.AseClient.dll
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.DLL
Method Exit: DataAccessAdapterBase.ExecuteActionQuery
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.DLL
Method Enter: DataAccessAdapterBase.Rollback
Method Exit: DataAccessAdapterBase.Rollback
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.DLL
Method Enter: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.SaveEntityCollection(3)
Any help greatly appreciated!