【发布时间】:2021-11-13 15:39:07
【问题描述】:
在 SQL Server 中
update incident_info
set description = N'ဆေးလိပ်'
where incidentid = 5
此查询在 SQL Server 中是正确的,并且在数据库中正确显示缅甸字体。
我想在下面的插入查询中编写正确的查询。
sqlUtil.SqlDataUpdate(false, ("INSERT INTO Incident_Info (incidentid, incidentdate, incidenttime, description, Salesmen_id, name, phone, email, address, cost, currency, solution, status)" +
"VALUES (@incidentid, @incidentdate, @incidenttime, N'+@description+', @salesmenid, N'+@name+', @phone, @email, N'+@address+', @cost, @currency, N'+@solution+', @status)"), SysController.dicParams);
【问题讨论】:
-
您只需将参数定义为
SqlDbType.NVarChar- 参数名称前不需要N.....。sqlCmd.Parameters.Add("@description", SqlDbType.NVarChar, 100).Value = "......"- .NET 中的字符串默认已经是 Unicode 字符串
标签: c# .net sql-server