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.
I'd concur too, as an informed enthusiast I'd find it a good deal, but your average Joe just wants cheap as possible and it's hard to beat Amazon or Ebay builds for that.
An Air India plane with 242 people on board crashed Thursday near a major international airport in the western Indian city of Ahmedabad, the airline and the country's government said.
https://www.nbcnews.com/world/asia/air-india-plane-crashes-indias-ahmedabad-airport-rcna212545
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
https://www.neowin.net/forum/topic/1344904-c-maxlength-violated-on-column-in-idataadapterfill-implementation/Share on other sites
1 answer to this question
Recommended Posts