Calling a stored procedure with Umlauts (äöü) does not store these correctly in
the database
--------------------------------------------------------------------------------------------
Key: DNET-453
URL: http://tracker.firebirdsql.org/browse/DNET-453
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Affects Versions: 2.7.7
Environment: Windows 7,
Visual Studio 2010 .Net 4.0,
Latest Firebird DB, latest Firebird .Net Provider
Reporter: Ashwani Mehlem
Assignee: Jiri Cincura
Priority: Critical
When calling a stored procedure with a named parameter that contains Umlauts,
these Umlauts get corrupted before the stored procedure is entered.
The same issue does not happen when the parameter is used to issue an
update-statement.
This happened no matter what values where used for:
- Charset in the connection string
- Charset in the parameter
- FbDBType in the parameter
- DbType in the parameter
It seems as if the Charset gets ignored when calling a stored procedure that
accepts a blob.
Code that produced the error:
char separator = Convert.ToChar(31);
string databaseConnectionString =
"Database=D:\\EON\\Datenbank\\GS.fb2";
databaseConnectionString += ";User=SYSDBA";
databaseConnectionString += ";Password=masterkey";
databaseConnectionString += ";CharSet=NONE";
databaseConnectionString += ";ServerType=0";
FbConnection connection = new
FbConnection(databaseConnectionString);
connection.Open();
var command = new FbCommand("EXECUTE PROCEDURE
UpdateOrInsertGSObject('Systemkennzeichen 4', 1, '0324 00BFL', 1, 0,
@propNames, @propValues)", connection);
byte[] bytesPropertyNames =
Encoding.GetEncoding(1252).GetBytes("Name" + separator);
byte[] bytesPropertyValues =
Encoding.GetEncoding(1252).GetBytes("Äöü" + separator);
command.Parameters.Add("@propNames", bytesPropertyNames);
FbParameter value = new FbParameter("@propValues",
bytesPropertyValues);
value.Charset = FbCharset.None;
value.FbDbType = FbDbType.Text;
value.DbType = DbType.String;
value.Direction = ParameterDirection.Input;
command.Parameters.Add(value);
command.ExecuteNonQuery();
command.Dispose();
connection.Close();
--
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider