|
代码如下:
SqlCommand cmd = new SqlCommand("UserIsExict",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Uid",SqlDbType.Binary,30));
cmd.Parameters["@Uid"].Value = Encoding.UTF32.GetBytes(paraUid);
cmd.Parameters.Add(new SqlParameter("@UserName",SqlDbType.Binary,30));
cmd.Parameters["@UserName"].Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
想获取cmd中的参数"@UserName"的值且转换为string类型,参数"@UserName"是binary类型的, |
|