SQL Server连接字符串关键字虽然不应该区分大小写,但它们区分大小写 [英] SQL Server connection string keywords act as case sensitive although they shouldn't be
问题描述
我使用.NET的OdbcConnectionStringBuilder来更新从配置文件读取的连接字符串,这使得其键变为小写,如MS所示(->"data source").
I use .NET's OdbcConnectionStringBuilder to update a connection string read from a config file, which makes its keys lower case, as documented by MS ("Data Source" -> "data source").
连接字符串用于访问MS SQL Server(如果有区别,请访问2008).
The connection string is used to access MS SQL Server (2008, if it makes a difference).
它在我的机器(Windows 7 32位)上正常工作,并且根据 MS的文档应该起作用:
It works fine on my machine (Windows 7 32 bit), and according to MS's documentation it should work:
关键字不区分大小写
Keywords are not case sensitive
但是,在其他几台机器上(至少一些是64位),无法使用此小写字母打开与DB的连接.仅在将关键字手动更改为其原始大小写(每个单词的字母大写)之后,DB连接才打开.
However, on several other machines (at least some are 64 bit), the connection to DB could not be opened with this lower case. Only after changing the keywords manually to their original casing (upper case on the letter of each word) the DB connection was opened.
连接字符串中的关键字(所有关键字均已修改为小写):
The keywords in the connection string (all were modified to lower case):
-
Data Source
-
Initial Catalog
-
Integrated Security
Data Source
Initial Catalog
Integrated Security
推荐答案
您是否看过排序规则设置?
Have you looked at collation settings?
http://msdn.microsoft.com /en-us/library/ms143508(v=sql.105).aspx
这篇关于SQL Server连接字符串关键字虽然不应该区分大小写,但它们区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!