Re: how does ado.net SqlDataReader.GetString() know which encoding to read the



how does ado.net SqlDataReader.GetString() know which encoding to read the
data into a string as? Does sql sever set this at the column data type
level, server wide encoding setting, os encoding?

In SQL Server, you can define collation on column level. If not, default for
all columns is database collataion; for database collation, default is
server collation. You can specify collation explicitly in the connection
string:

- in Ado.Net, use the Current Language property. If this property is not set
explicitly, SQL Server uses either its system default language or a
user-specific default language, depending on its configuration.
- in ADO, use the Language keyword in a provider string.
- in OLE DB, you can also set the provider-specific property
SSPROP_INIT_CURRENTLANGUAGE before connecting.
- For ODBC, include the LANGUAGE keyword.
- Independently of application you can use SET LANGUAGE T-SQL command to
change the language for a session.

--
Dejan Sarka
http://www.solidqualitylearning.com/blogs/


.



Relevant Pages

  • Re: DateTime Format in Localized version of MSDE
    ... You are right that datetime and smalldatetime in SQL Server are stored in ... a binary, language-neutral format. ... deleting depends on the language setting for the connection, ... collation is irrelevant for datetime. ...
    (microsoft.public.sqlserver.msde)
  • Re: Russian Language support in SQL SERVER
    ... SQL Server supports languages on a couple of levels. ... specifying a collation defines what language rules are used for ... Cyrillic_general Windows collation that supports the Russian language. ...
    (microsoft.public.sqlserver.server)
  • Re: collation setup
    ... Language settings are not the same thing as collations. ... If you set the Server Default language to British and change the language ... regardless of your collation setting. ... Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.setup)
  • Re: Unexpected LIKE behavior
    ... DECLARE @String AS varchar ... The server collation, if ... I suspect that this is a case of wrong expectations. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Operator overloading in C
    ... All development of C as an independent language has ... making any changes or improvements to the standard ... The lack of a counted string data structure, ... Pointers can't be used for arg1 or arg2. ...
    (comp.std.c)

Loading