How to display non unicode characters (like chinese characters) in a vb.net web page

I am retrieving nvarchar values from an sql2005 database that contain chinese characters.

Firstly, I am storing chinese characters as nvarchar data type. I am able to save the data as chinese characters but when I view the table on MSSQL 2005 I cannot see chinese characters. But  if I clipboard the field it will paste as chinese characters so I am pretty sure the database preserves them somehow.

But when I retrieve the value into a textbox or a label on a webform it will always display as ???????? (literally).

Any clues?

JOHNFROGAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BurniePCommented:
Maybe decoding it with HttpUtility.HtmlDecode..

Example :

Dim myWriter As New StringWriter()

HttpUtility.HtmlDecode(myChineseEncodedString, myWriter)
MyTextBox.Text = myWriter.ToString()

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Den_HBRCommented:
I think you are using a font that doesn't have the chinese characters.
JOHNFROGAuthor Commented:
Thanks for the advice but neither of these fixed my problem.

However, I did manage to find a fix for this.

When working with the VarChar filed in VB code I was wrongly using this line of code
command.Parameters.Add("@afield", SqlDbType.VarChar).Value = avalue

when i should have been using this one
command.Parameters.Add("@afield", SqlDbType.NVarChar).Value = avalue
JOHNFROGAuthor Commented:
my question was not well enough constructed to have given these experts a chance. thanks anyway.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.