public static string fUtilityPutDataTable(string handle, object[,] data) { PersistentObjects.AssertReservedWordsTableName(handle); PersistentObjects.AddToMap(handle, ExcelFriendlyConversion.ConvertObjectArrayToDataTable(handle, data), "DATATABLE"); return(handle); }
public static string fUtilityObjectsStoreSql(string handle, object[] sqlStatement) { string sql = fUtilityReadSql(sqlStatement); PersistentObjects.AddToMap(handle, sql, "SQL"); return(handle); }
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); }
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); } }