Last post Aug 07, 2012 09:54 AM by Ciove
Aug 07, 2012 06:04 AM|Ciove|LINK
I've done .NET 4.0 DynamicData website with VisualStudio, my database is on a MS SQL 2005 server and I connect to .
All is fine and dandy, thanks to this forum and Asp.net's Getting Started videos, except I cannot figure out how to save to database a textfield which contains other than Windows-1252 characters, Russian characters for example (Windows-1251).
In the olden days, with classic asp, I've done something like this:
Set objConnection = Server.CreateObject("ADODB.Connection")
strSqlStmt = "INSERT INTO mytable values ("
strSqlStmt = strSqlStmt & "'myfirstvalue', "
strSqlStmt = strSqlStmt & "N''Some Russian: ёЁйЙцЦ')"
'N means that the <--------+
'characters are saved in Unicode format.
Set objRs = objConnection.Execute(strSqlStmt)
How do I do the "N'" -thing with .NET 4.0 DynamicData?
Aug 07, 2012 09:54 AM|Ciove|LINK
I'm answering my own question:
You need to define the database column correctly. My field's (or column as its is called in MS SQL) datatype was varchar as it should have been nvarchar.