I am implementing IDataRecord, IDataReader and IDataAdapter to add, modify and delete records in a proprietary flat-file structure in which I have the source code to. I have a working implementation with classes I wrote to access the data but I am trying to write something more universally useful.
That being said, I am running into an ArgumentException ("Cannot set column 'Header_Checksum'. The value violates the MaxLength limit of this column."). The error SEEMS concise and useful but the MaxLength on the column is set to 11. 11 being far more bytes than Int32 takes up and more digits than Int32 contains. The only Constraint on the table is the PK which is at the end ("RecordPosition").
Any ideas on where to look next? Everything works fine if I disable EnforceConstraints but I'd like to keep that enabled for sanity sake if I can.
Attached is a screenshot with a watch on the offending value and the DataColumn properties.
Question
Squirrelington
I am implementing IDataRecord, IDataReader and IDataAdapter to add, modify and delete records in a proprietary flat-file structure in which I have the source code to. I have a working implementation with classes I wrote to access the data but I am trying to write something more universally useful.
That being said, I am running into an ArgumentException ("Cannot set column 'Header_Checksum'. The value violates the MaxLength limit of this column."). The error SEEMS concise and useful but the MaxLength on the column is set to 11. 11 being far more bytes than Int32 takes up and more digits than Int32 contains. The only Constraint on the table is the PK which is at the end ("RecordPosition").
Any ideas on where to look next? Everything works fine if I disable EnforceConstraints but I'd like to keep that enabled for sanity sake if I can.
Attached is a screenshot with a watch on the offending value and the DataColumn properties.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts