Z
zhanweixin
Unregistered / Unconfirmed
GUEST, unregistred user!
C#代码如下:
[WebMethod(Description="修改操作员信息")]
public string Update_Operator(string User_ID, string User_Name, int Home, int Depart, int User_Type, int Auth, string ID_Card, string Exprie_Date, string Creator, string MSISDN, int Status)
{
OleDbCommand cmd = new OleDbCommand("sp_update_operator", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OleDbParameter("i_UserID", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_ID));
cmd.Parameters.Add(new OleDbParameter("i_Name", OleDbType.VarWChar, 20, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_Name));
cmd.Parameters.Add(new OleDbParameter("i_Home", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Home));
cmd.Parameters.Add(new OleDbParameter("i_Depart", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Depart));
cmd.Parameters.Add(new OleDbParameter("i_UserType", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_Type));
cmd.Parameters.Add(new OleDbParameter("i_Auth", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Auth));
cmd.Parameters.Add(new OleDbParameter("i_Card", OleDbType.VarChar, 32, ParameterDirection.Input, true, 0, 0, "RegionID", DataRowVersion.Current, ID_Card));
cmd.Parameters.Add(new OleDbParameter("i_Exprie", OleDbType.VarChar, 8, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Exprie_Date));
cmd.Parameters.Add(new OleDbParameter("i_MSISDN", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, MSISDN));
cmd.Parameters.Add(new OleDbParameter("i_Creator", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Creator));
cmd.Parameters.Add(new OleDbParameter("i_Stat", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Status));
cmd.Parameters.Add(new OleDbParameter("o_Result", OleDbType.VarChar, 64, ParameterDirection.Output, true, 0, 0, "RegionID", DataRowVersion.Current, ""));
try
{
conn.Open();
cmd.ExecuteNonQuery();
return cmd.Parameters["o_Result"].Value.ToString();
}
catch (Exception ex)
{
return ex.Message.ToString();
}
finally
{
conn.Close();
}
}
Oracle存储过程参数如下:
create or replace procedure sp_update_operator(i_User_ID in number,
i_Name in varchar2,
i_Home in number,
i_Depart in number,
i_UserType in number,
i_Auth in number,
i_Card in varchar2,
i_Exprie in varchar2,
i_MSISDN in varchar2,
i_Creator in number,
i_Stat in number,
o_Result out varchar2)
在C#中执行SQL语句可以正常插入或修改数据,可用如上方法进行修改数据若提交中文的操作员姓名,查询表中的数据变成了乱码,请问该如何解决?
在线等待
[WebMethod(Description="修改操作员信息")]
public string Update_Operator(string User_ID, string User_Name, int Home, int Depart, int User_Type, int Auth, string ID_Card, string Exprie_Date, string Creator, string MSISDN, int Status)
{
OleDbCommand cmd = new OleDbCommand("sp_update_operator", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OleDbParameter("i_UserID", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_ID));
cmd.Parameters.Add(new OleDbParameter("i_Name", OleDbType.VarWChar, 20, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_Name));
cmd.Parameters.Add(new OleDbParameter("i_Home", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Home));
cmd.Parameters.Add(new OleDbParameter("i_Depart", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Depart));
cmd.Parameters.Add(new OleDbParameter("i_UserType", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, User_Type));
cmd.Parameters.Add(new OleDbParameter("i_Auth", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Auth));
cmd.Parameters.Add(new OleDbParameter("i_Card", OleDbType.VarChar, 32, ParameterDirection.Input, true, 0, 0, "RegionID", DataRowVersion.Current, ID_Card));
cmd.Parameters.Add(new OleDbParameter("i_Exprie", OleDbType.VarChar, 8, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Exprie_Date));
cmd.Parameters.Add(new OleDbParameter("i_MSISDN", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, MSISDN));
cmd.Parameters.Add(new OleDbParameter("i_Creator", OleDbType.VarChar, 11, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Creator));
cmd.Parameters.Add(new OleDbParameter("i_Stat", OleDbType.Integer, 4, ParameterDirection.Input, false, 0, 0, "RegionID", DataRowVersion.Current, Status));
cmd.Parameters.Add(new OleDbParameter("o_Result", OleDbType.VarChar, 64, ParameterDirection.Output, true, 0, 0, "RegionID", DataRowVersion.Current, ""));
try
{
conn.Open();
cmd.ExecuteNonQuery();
return cmd.Parameters["o_Result"].Value.ToString();
}
catch (Exception ex)
{
return ex.Message.ToString();
}
finally
{
conn.Close();
}
}
Oracle存储过程参数如下:
create or replace procedure sp_update_operator(i_User_ID in number,
i_Name in varchar2,
i_Home in number,
i_Depart in number,
i_UserType in number,
i_Auth in number,
i_Card in varchar2,
i_Exprie in varchar2,
i_MSISDN in varchar2,
i_Creator in number,
i_Stat in number,
o_Result out varchar2)
在C#中执行SQL语句可以正常插入或修改数据,可用如上方法进行修改数据若提交中文的操作员姓名,查询表中的数据变成了乱码,请问该如何解决?
在线等待