From: <car...@us...> - 2006-01-31 18:49:39
|
Update of /cvsroot/firebird/NETProvider/NETProvider_20/source/FirebirdSql/Data/FirebirdClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22429 Modified Files: FbCommand.cs Log Message: 2006-01-31 Carlos Guzmán Álvarez <car...@te...> * FirebirdSql\Data\FirebirdClient\FbCommand.cs: * FirebirdSql\Data\Common\Charset.cs: * FirebirdSql\Data\Common\DbValue.cs: - Changes on char/varchar octets fields support. Index: FbCommand.cs =================================================================== RCS file: /cvsroot/firebird/NETProvider/NETProvider_20/source/FirebirdSql/Data/FirebirdClient/FbCommand.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -b -U3 -r1.27 -r1.28 --- FbCommand.cs 12 Dec 2005 15:03:44 -0000 1.27 +++ FbCommand.cs 31 Jan 2006 18:49:28 -0000 1.28 @@ -903,17 +903,18 @@ FbDbType type = parameter.FbDbType; // Check the parameter character set - if (parameter.Charset != FbCharset.Default) + if (parameter.Charset == FbCharset.Octets && !(parameter.Value is byte[])) { - int idx = Charset.SupportedCharsets.IndexOf((int)parameter.Charset); - charset = Charset.SupportedCharsets[idx]; + throw new InvalidOperationException("Value for char octets fields should be a byte array"); } - else - { - if (type == FbDbType.Guid) + else if (type == FbDbType.Guid) { charset = Charset.SupportedCharsets["OCTETS"]; } + else if (parameter.Charset != FbCharset.Default) + { + int idx = Charset.SupportedCharsets.IndexOf((int)parameter.Charset); + charset = Charset.SupportedCharsets[idx]; } // Set parameter Data Type |