Monday, December 10, 2007

The field is too small to accept the amount of data you attempted to add

Like the other developers, the error code print out would make easier to find out the way where we must to debug and fix the problem.

Like the error code below
System.Data.OleDb.OleDbException: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at Register.ExecuteCommand(String MyCmd) in d:\Project\fake\UserManagement\Register.aspx.cs:line 60
The error code above represent that our Table Field Size didn't have sufficient Field Size to handle the data longer than the available Field Size.

On Ms. Access database the default length for Text Data Type is 50. The maximum length of a Text Data Type is 255. So, please provide the sufficient Field Size for the data you want to be saved on an Access database.

If the data is longer than 255 it might you need consider to use a Memo field, then you can get a whole lot more characters, but this may be overkill.

No comments: