用存储过程插入中文出现乱码
我的空间是放在国外的服务器上,用的是sql server2005的数据库,英文版操作系统.当我向数据库插入中文字符时,就出现乱码.因为我的代码全部是用存储过程来写的,如果有insert语句到是可以在字段前加'N'(Insert into tablename(title)values(N'中文标题') )来防止中文乱码?但我用的存储过程,我要怎样修改了?代码如下:
CREATE PROCEDURE [Stu_InsertAbout]
@title nvarchar(100)
AS
Insert into Stu_About(title)
Values
(@title)
GO
C#代码:
public int InsertAbout(About about_list)
{
SqlParameter[] param =
{
DataClass.MakeInParam("@title", SqlDbType.NVarChar,100,about_list.title)
};
try
{
int id = DataClass.ExecuteNonQuery("Stu_InsertAbout", param);
return id;
}
catch
{
return 0;
}
}
public static SqlParameter MakeInParam(string ParamName, SqlDbType DbType, int Size, object Value)
{
return MakeParam(ParamName, DbType, Size, ParameterDirection.Input, Value);
}
public static SqlParameter MakeParam(string ParamName, SqlDbType DbType, Int32 Size, ParameterDirection Direction, object Value)
{
SqlParameter param;
param = MakeParam(ParamName, DbType, Size);
param.Direction = Direction;
if (!(Direction == ParameterDirection.Output && Value == null))
param.Value = Value;
return param;
}
也就是说我的值是通过SqlParameter 参数传递的.我要怎样修改了?