Asp.net UpdateLog
2009-03-16 16:12 LvSir 阅读(155) 评论(0) 编辑 收藏 举报public void UpdateLog(string loginName)
{
OleDbConnection myConn = GetConnection();
String sql = "update NwebCn_Admin set LastLoginTime=@LastLoginTime,LastLoginIP=@LastLoginIP where AdminName= @AdminName";
OleDbCommand myCmd=new OleDbCommand(sql,myConn);
myCmd.Parameters.Add(new OleDbParameter("@LastLoginTime"), OleDbType.Date, 8);
myCmd.Parameters["@LastLoginTime"].Value=System.DateTime.Now();
myCmd.Parameters.Add(new OleDbParameter("@AdminName"),OleDbType.VarChar,50);
myCmd.Parameters["@AdminName"].Value=loginName;
myCmd.ExecuteScalar();
myCmd.Dispose();
myConn.Close();
}