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

            PersistentObjects.AddToMap(handle, ExcelFriendlyConversion.ConvertObjectArrayToDataTable(handle, data), "DATATABLE");
            return(handle);
        }
예제 #2
0
        public static string fUtilityObjectsStoreSql(string handle, object[] sqlStatement)
        {
            string sql = fUtilityReadSql(sqlStatement);

            PersistentObjects.AddToMap(handle, sql, "SQL");
            return(handle);
        }
예제 #3
0
        public static string fUtilityDataBasePutDataTableFromSQLADODB(string handle, string connectionString, string sqlStringOrHandle)
        {
            PersistentObjects.AssertReservedWordsTableName(handle);

            string sql = ObjectInfo.DetermineIfSqlHandleOrSqlQuery(sqlStringOrHandle);

            if (ExcelDnaUtil.IsInFunctionWizard())
            {
                return("no wizard.");
            }
            var table = DatabaseFunctionality.GetDataTableFromSQLAdoDb(sql, connectionString);

            table.TableName = handle;
            PersistentObjects.AddToMap(handle, table, "DATATABLE");
            return(handle);
        }
예제 #4
0
        public static string fUtilityQueryDataTable(string handle, string sqlStringOrHandle)
        {
            PersistentObjects.AssertReservedWordsTableName(handle);

            string sql         = ObjectInfo.DetermineIfSqlHandleOrSqlQuery(sqlStringOrHandle);
            var    tableHandle = ParsingFunctionality.GetTableNameFromSqlQuery(sql);

            if (PersistentObjects.ContainsKey(tableHandle, "DATATABLE") == false)
            {
                return("ERROR: DataTable + " + tableHandle + " does not exist in the object map.");
            }
            else
            {
                var newTable = QueryCSV.QueryDataTable(sql, PersistentObjects.CsvPath);
                newTable.TableName = handle;
                PersistentObjects.AddToMap(handle, newTable, "DATATABLE");
                return(handle);
            }
        }