예제 #1
0
        /// <summary>
        /// This method builds a SQL Select statement to perfrom on the SQLite DB
        /// </summary>
        /// <param name="TableName">The name of the table to be queried</param>
        /// <param name="SelectFields">A variable that contains multiple fields to select from the table</param>
        /// <param name="Variables">Contains the variables and values for the WHERE portion of the query</param>
        /// <param name="separator">In case a different separator is wanted for the query than a comma</param>
        public void DoQuery(string TableName, SQLVars SelectFields, SQLWhereVars Variables, string separator = ", ")
        {
            SQLSelectTable table = new SQLSelectTable(TableName, SelectFields, Variables);

            DoSelectCommand(table);//.GetSql(), table.GetWhereFields());
            //string fields = SelectFields.GetFieldNames(separator);
            //DoQuery(TableName, fields, Variables, separator);
        }
예제 #2
0
        /// <summary>
        /// The method builds a SQL Select statement to perform on the SQLite DB
        /// </summary>
        /// <param name="TableName">The table name to be queried</param>
        /// <param name="SelectField">The field to select in the query</param>
        /// <param name="Variables">Contains the variables and values for the WHERE portion of the query</param>
        /// <param name="separator">In case a different separator is wanted for the query than a comma</param>
        public void DoQuery(string TableName, string SelectField, SQLWhereVars Variables, string separator = ", ")
        {
            SQLSelectTable table = new SQLSelectTable(TableName, SelectField, Variables);

            //string command = "SELECT " + SelectField + " FROM " + TableName;
            //command += " WHERE ";
            //command += Variables.GetWhereFieldEqualsValue();
            //command += ";";
            DoSelectCommand(table);// command, Variables);
        }
예제 #3
0
        /// <summary>
        /// Constructor that takes the table name, there where values that are to be used delete the matching records. It can also take a bool value to delete everything
        /// </summary>
        /// <param name="sqlcon"></param>
        /// <param name="TableName"></param>
        /// <param name="WhereFields"></param>
        /// <param name="deleteallrecords"></param>
        public SQLiteDelete(SQLiteConnection sqlcon, string TableName, SQLWhereVars WhereFields, bool deleteallrecords = false)
        {
            SQLDeleteTable table = new SQLDeleteTable(TableName, WhereFields, deleteallrecords);

            DoDeleteCommand(sqlcon, table);
        }
예제 #4
0
        public SQLiteUpdate(SQLiteConnection sqlcon, string TableName, SQLVarsVals Fields, SQLWhereVars WhereFields)
        {
            SQLUpdateTable table = new SQLUpdateTable(TableName, Fields, WhereFields);

            DoUpdateCommand(sqlcon, table);
        }
예제 #5
0
 private void DoSelectCommand(string commandtext, SQLWhereVars Variables)
 {
     DoSelectCommand(commandtext, Variables.GetVarsVals());
 }