how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Do

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

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?
 
Daniel said:
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?

If it is an NVARCHAR you should not have a problem since that is Unicode
like .NET strings.

For a VARCHAR it is much more "fun". I really don't know how
it is done. But if I were to guess based on my small knowledge about
TDS, then I would say that the client tell the server what
charset it is using and the server then delivers the bytes
in the matching charset.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top