Arithmetic exception, numeric overflow, or string truncation
------------------------------------------------------------
Key: DNET-237
URL: http://tracker.firebirdsql.org/browse/DNET-237
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Affects Versions: 2.1.0
Environment: Windows Vista, Windows 2003 Server, Windows XP. Using
firebird embedded version for .NET framework 2.0
Reporter: sander bosman
Assignee: Jiri Cincura
When i have a string value that is to big to store in the dataset i adjust the
size of the dataset with the length of the string + 1 and update the firebird
database. The first time i'm entering the function that does the resize the
columnsize of the dataset database it works correct. But when the function is
called a second time the dataset and the database is resize again and stored
the information in the database.
But when i try too store the value that is was too big too store in the
database it gives the following error "Arithmetic exception, numeric overflow,
or string truncation".
the function looks like this:
int columnNewSize = theValue.Length + 1;
string str = "ALTER TABLE " + TableSA + " ALTER column \"" + eLink.ToLower() +
"\" TYPE VARCHAR(" + (columnNewSize) + ")";
FirebirdSql.Data.FirebirdClient.FbCommand commandChangeColumn = new
FirebirdSql.Data.FirebirdClient.FbCommand(str, Connection);
commandChangeColumn.Transaction = Connection.BeginTransaction();
commandChangeColumn.ExecuteNonQuery();
commandChangeColumn.Transaction.Commit();
commandChangeColumn.Dispose();
RecordSet.Tables[TableSA].Columns[eLink].MaxLength = columnNewSize;
As a workaround because its really a bug (because the firstime it works fine
adjusting the columnsize and the value can be stored in the database but not
the secondtime) when the function is called i have below the function and then
it works:
Connection.Close();
Connection.Open();
greetings,
Sander
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider