コード例 #1
0
ファイル: ABHerbController.cs プロジェクト: kortego/AskAbyApi
        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;
            }
        }
コード例 #2
0
ファイル: WebForm1.aspx.cs プロジェクト: kortego/AskAbyApi
        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;
            }
        }
コード例 #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;
            }
        }
コード例 #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;
        }