Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Russian Text in Insert Into

Status
Not open for further replies.

abig99

Programmer
Oct 22, 2001
53
GB
Hi All,

I have created an INSERT INTO that adds russian text to one of my SQL databases, however, the russian text appears in the database as ??? where the actual characters should be.

I initially thought it was because my collation was incorrect as it was set to default for the database so I set up a test database with a collation I (from reading various threads) thought should work "SQL_Latin1_General_CP1_CI_AS", but again it still only inserts question marks, I can however copy and paste this text in manusally and its fine.

The next thing I turned to was the database connection, is there a language setting I need to set on here?

<add name="ConnectionString" connectionString="Data Source=SERVERNAME;Initial Catalog=&quot;DATABASE NAME;;Persist Security Info=True;User ID=Login" providerName="System.Data.SqlClient"/>

Any help appreciated.
Regards
H Jones
 
Collegue resolved this for me.

Its a known globalization issue with SQL Server and ASP.NET apparently.

on the insert into you need to add an N in front of each field you want to become Unicode.

so:

INSERT INTO ORDERS (OrderNo, DelName, Title) Values ('" & vOrderNo & "',, '" & DelNametxt.text & "', '" & DelTitletxt.text & "')"

Where DelTitletxt.text is russian characters

Would become:

INSERT INTO ORDERS (OrderNo, DelName, Title) Values ('" & vOrderNo & "',, '" & DelNametxt.text & "', N'" & DelTitletxt.text & "')"

Note the N added to signify unicode.

So big ups to J Young for this.

Regards
H Jones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top