Skip to content

Commit 4757380

Browse files
authored
Merge pull request #314 from DataObjects-NET/6.0-british-english-messages
SqlServer: Adds British English (code 23) as English for ErrorMessageParser.
2 parents 25a7e81 + 1702462 commit 4757380

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ChangeLog/6.0.12_dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
[main] Addressed DataTypeCollection.Add method issue of wrong adding storage-specifid types to the collection
1+
[main] Addressed DataTypeCollection.Add method issue of wrong adding storage-specifid types to the collection
2+
[sqlserver] Sql error messages for British English are correctly parsed

Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/DriverFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ private static ErrorMessageParser CreateMessageParser(SqlServerConnection connec
4444
bool isEnglish;
4545
using (var command = connection.CreateCommand()) {
4646
command.CommandText = LangIdQuery;
47-
isEnglish = command.ExecuteScalar().ToString()=="0";
47+
var langId = (short) command.ExecuteScalar();
48+
isEnglish = langId == 0 || langId == 23;
4849
}
4950
var templates = new Dictionary<int, string>();
5051
using (var command = connection.CreateCommand()) {

0 commit comments

Comments
 (0)