static void Main(string[] args) { Console.WriteLine("Executing the WeatherLogger Task...."); // Set the xml url string url = "http://w1.weather.gov/xml/current_obs/KEWR.xml"; string XmlStr; // Create the DownloadXML object DownloadXML XmlObj = new DownloadXML(url); XmlStr = XmlObj.DownloadWeatherXML(); if (XmlStr == null) { Environment.Exit(0); } else { InsertIntoDb DbObj = new InsertIntoDb(); DbObj.InsertData(XmlStr); } Console.WriteLine("Done"); //Console.Read(); }