SqlConnection con = new SqlConnection("连接字符串"); SqlCommand cmd = new SqlCommand("SelectManStudent", con); SqlParameter parm = new SqlParameter("@Sex", SqlDbType.NVarChar); parm.Value = '男';//此处传性别 cmd.Parameters.Add(parm); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds); con.Close(); //ds就是查出来的结果集