Ejemplo n.º 1
0
 public static DateTime GetServerDateTime()
 {
     using (DBCheckup.InhCheckupDataContext dbc = new DBCheckup.InhCheckupDataContext())
     {
         DateTime nowdatetime = Convert.ToDateTime(dbc.ExecuteQuery <DateTime>("select GetDate()").FirstOrDefault());
         return(nowdatetime);
     }
 }
Ejemplo n.º 2
0
 public static Boolean CheckIsConnection()
 {
     try
     {
         using (DBCheckup.InhCheckupDataContext dbc = new DBCheckup.InhCheckupDataContext())
         {
             DateTime nowdatetime = Convert.ToDateTime(dbc.ExecuteQuery <DateTime>("select GetDate()").FirstOrDefault());
             return(true);
         }
     }
     catch
     {
         Program.MessageError("Check Connection", "001", "Can not Connect DataBase SQL");
         return(false);
     }
 }