Example #1
0
        public static string fUtilityPutDataTable(string handle, object[,] data)
        {
            PersistentObjects.AssertReservedWordsTableName(handle);

            PersistentObjects.AddToMap(handle, ExcelFriendlyConversion.ConvertObjectArrayToDataTable(handle, data), "DATATABLE");
            return(handle);
        }
Example #2
0
        public static object[,] fUtilityTableSortByHeader(object[,] table, object[] headers, object SortAscending, object noHeadersInput)
        {
            bool ascending = Optional.Check(SortAscending, true);
            bool noHeaders = Optional.Check(noHeadersInput, false);

            var dataTable = ExcelFriendlyConversion.ConvertObjectArrayToDataTable("TEMPTABLE", table);
            var header    = "";

            for (int i = 0; i < headers.Length - 1; i++)
            {
                header = headers[i].ToString() + ", " + header;
            }

            header = header + headers[headers.Length - 1];

            var direction = (ascending) ? "ASC" : "DESC";

            dataTable.DefaultView.Sort = header + " " + direction;

            return(ExcelFriendlyConversion.ConvertDataTableToObjectArray(dataTable.DefaultView.ToTable()));
        }
Example #3
0
        static void TestSQLite()
        {
            var            table = CreateTestTable();
            SQLiteDatabase db    = new SQLiteDatabase("MYDB");

            db.CreateTable("MYTABLE", table);
            var table2 = db.InspectDatabase();
            var table3 = db.GetDataTable("MYTABLE");

            var obj    = CreateTestArray();
            var table4 = ExcelFriendlyConversion.ConvertObjectArrayToDataTable("MYTABLE4", obj);

            PrintTableInfoToConsole(table4);

            db.CreateTable("MYTABLE4", table4);
            var table5 = db.GetDataTable("MYTABLE4");

            PrintTableInfoToConsole(table5);


            Console.WriteLine("Database created ..");
        }