|
code show as below:
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 ();
I want to get the value of the parameter "@UserName" in cmd and convert it to string type. The parameter "@UserName" is binary type. |
|