예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // todo:  call db and check last run, this will prevent spoofing of the url request

            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_insert"))
                {
                    sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                    sqlCommand.Parameters.Add(new SqlParameter("@serverUTCDate", "test date"));
                    sqlCommand.Parameters.Add(new SqlParameter("@jsonData", "{testing db from console app}"));

                    da.executeSqlCommandStoredProcedure(sqlCommand);

                    da = null;

                }
            }
            catch (Exception ex)
            {
                //ErrorLoggingController el = new ErrorLoggingController();
                //el.LogToDatabase(PCName, "Failed to reset ContentDownload_Timestamp.", string.Format("GateName {0} - {1} {2}", PCName, ex.Message, ex.StackTrace));
                //el = null;
            }
        }
예제 #2
0
        public void insert(string jsonData)
        {
            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_insert"))
            {
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(new SqlParameter("@jsonData", jsonData));
                da.executeSqlCommandStoredProcedure(sqlCommand);

                da = null;
            }
        }
예제 #3
0
        public string getLastEntry()
        {
            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_getLastEntry"))
            {
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
                da.executeSqlCommandStoredProcedure(sqlCommand);

                da = null;
            }

            return string.Empty;
        }