示例#1
0
        //Creates a SQL table from datatable information
        private void createDataTableToSQL(DataTable dt)
        {
            SQLPush sqlPush = new SQLPush();

            sqlPush.createTableQuery(dt, true);
            sqlPush.insertToTable(dt);
        }
        //Pushes the error to an SQL table
        public static void createError(String message, Exception e)
        {
            SQLPush sqlPush = new SQLPush();

            if (!(errorCreated))
            {
                //Creates datatable
                DataTable dt = new DataTable();

                dt.Columns.Add("id");
                dt.Columns.Add("error");
                dt.Columns.Add("exception");
                dt.Columns.Add("time");

                //pushes the data to MS SQL
                dt.TableName = "ErrorLogs";
                sqlPush.createTableQuery(dt, true);
                addToErrorTable(e, message, sqlPush);
                errorCreated = true;
            }
            else
            {
                addToErrorTable(e, message, sqlPush);
            }
            id++;
        }