收集

Convert.ToDateTime("08/07/01").CompareTo(Convert.ToDateTime(DateTime.Now.ToString("yy/MM/dd")))

 

//调用存储过程

string conn=连接数据库字符串 
SqlParameter para = new SqlParameter("@name",SqlDbType.Char,10); 
para.Direction = ParameterDirection.Input; 
para.Value = 名字; 
SqlParameter para2 = new SqlParameter("@pwd",SqlDbType.Char,10); 
para.Direction = ParameterDirection.Input; 
para.Value = 密码; 
SqlParameter para = new SqlParameter("@ISValid",SqlDbType.Char,10); 
para.Direction = ParameterDirection.ReturnValue; 
SqlCommand myCommand=new SqlCommand("CheckPass",conn)
myCommand.CommandType=CommandType.StoredProcedure; 
myCommand.Parameters.Add(para); 
myCommand.Parameters.Add(para2); 
myCommand.ExcuteNonQuery();
bool isvalid=myCommand.Parameters["@ISvalid"].value; //返回值

 

你可能感兴趣的:(收集)