godaddy sqlserver 插入中文错误(asp.net)

发表于

Ivan 发表于 2008-1-6 3:35:00

解决方法很简单,加N:

Dim cmd As New sqlCommand("insert into DB (owner,intro,title) values ('"& User &"','"& request.form("intro") &"','"& request.form("title") &"')", conn)

改为:

Dim cmd As New sqlCommand("insert into DB (owner,intro,title) values (N'"& User &"',N'"& request.form("intro") &"',N'"& request.form("title") &"')", conn)