开发者

ASP vs .NET database encoding issue

I have an old classic ASP application that stores information in a SQL Server 2008 database. I need to retrieve开发者_如何学运维 the information in a new .NET application but I am having some encoding issues.

When I look in SQL Management Studio or at the data retrieved in .NET text strings looks weird when it contain Danish characters, e.g “Øvrige” when it should have been “Øvrige”.

The ASP application uses MDAC 2.8 and the native driver with a connection string like:

Provider=SQLNCLI;DataTypeCompatibility=80;Server=.\SQLEXPRESS,1433;Database=MyDB;UID=MyUser;PWD=MyPwd

The database has a Danish_Norwegian_CI_AS collation but that does not seem to have any impact.

I must admit that I have forgotten most of my ASP skills so it may be pretty obvious.

It looks like the ASP application adds some extra encoding or something. Why does it do that?

How can I retrieve and update the information from the database in .NET?


The following line in the ASP files solves the issue and makes the it store the data correct and redisplay the new data correct:

<% @CodePage = 65001 %>

Now I just need to convert the entire database to solve the issue...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜