//string SessionNumber { get; set; } public override string HostName() { var lRs = new XMLRS(); lRs.Open("Select HostName=host_name()", this); if (lRs.EOF) { throw new Exception("Server not available"); } string lRes = lRs[0].ToString(); lRs.Close(); return(lRes); }
public override DateTime ServerDate() { var lRs = new XMLRS(); lRs.Open("Select Date=convert(varchar,Getdate(),120)", this); if (!lRs.HasRows) { throw new Exception("Server not available"); } string[] lDateTot = lRs[0].ToString().Split(' '); lRs.Close(); string[] lDate = lDateTot[0].Split('-'); string[] lTime = lDateTot[1].Split(':'); DateTime lRes = new DateTime(Convert.ToInt32(lDate[0]), Convert.ToInt32(lDate[1]), Convert.ToInt32(lDate[2]), Convert.ToInt32(lTime[0]), Convert.ToInt32(lTime[1]), Convert.ToInt32(lTime[2])); return(lRes); }