Ejemplo n.º 1
0
        public static void testSql()
        {
            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("budhill_herb_getall"))
                {
                    sqlCommand.CommandType = CommandType.StoredProcedure;

                    //sqlCommand.Parameters.Add(new SqlParameter("@PCName", PCName));
                    //sqlCommand.Parameters.Add(new SqlParameter("@ContentDownload_Timestamp", DBNull.Value));

                    DataTable dt = da.executeSqlCommandStoredProcedureDataset(sqlCommand);
                    //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;
            }
        }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
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;
            }
        }
Ejemplo n.º 4
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;
        }