示例#1
0
        public static DateTime GetServerDate(ClsConnection_SqlServer Cn)
        {
            DataTable Dt = Cn.ExecuteQuery("Select GetDate() As ServerDate").Tables[0];

            if (Dt.Rows.Count > 0)
            {
                return((DateTime)Dt.Rows[0][0]);
            }
            else
            {
                return(DateTime.Now);
            }
        }
示例#2
0
        public static DateTime GetServerDate()
        {
            ClsConnection_SqlServer Da = new ClsConnection_SqlServer();

            try
            {
                Da.Connect();
                return(GetServerDate(Da));
            }
            catch (Exception ex)
            { throw ex; }
            finally
            { Da.Close(); }
        }