??????δ????洢????
user testdatabase(?????????)
go
create procedure testname(?洢????????)
@test1 int?? @test2 nvarchar(50)
as
insert into testtable values(@test1??@test2)
return
//select * from users where truename like '%[????]%' //???????????????????????????
2 ??????
public string[] TestLogin(string uname?? string upwd)
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "User_Login";//?洢??????
cmd.Connection = conn;
cmd.Parameters.Clear();
cmd.Parameters.Add("@uname"?? SqlDbType.NVarChar?? 100).Value = uname;
cmd.Parameters.Add("@upwd"?? SqlDbType.NVarChar?? 100).Value = upwd;
string[] result = new string[3];
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
result[0] = dr["qx"].ToString();
result[1] = dr["tname"].ToString();
result[2] = dr["unitid"].ToString();
dr.Close();
return result;
}
else
{
return null;
}
}
catch (Exception e)
{
throw e;
}
finally
{
conn.Close();
}
}