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")
objConnection.Open "DSN=mydataset;UID=mylogin;PWD=mypw"
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?
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.
None
0 Points
2 Posts
.NET 4.0 DynamicData: How to save fields as unicode or UTF-8 to MS SQL 2005?
Aug 07, 2012 06:04 AM|Ciove|LINK
Hi all,
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:
How do I do the "N'" -thing with .NET 4.0 DynamicData?
None
0 Points
2 Posts
Re: .NET 4.0 DynamicData: How to save fields as unicode or UTF-8 to MS SQL 2005?
Aug 07, 2012 09:54 AM|Ciove|LINK
Hi again,
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.