public static bool EndProgress (Adapdev.IProgressCallback _callback, string message, bool ok) { if (_callback != null) { if (_callback.IsAborting) return false; _callback.SetText(message,""); _callback.SetRange(0, 1); if (ok) { _callback.StepTo(1); } else { _callback.StepTo(0); _callback.AddMessage(ProgressMessageTypes.Critical,"No database schema information found."); } } return true; }
/// <summary> /// Gets the OLE db schema. /// </summary> /// <param name="oledbConnectionString">Oledb connection string.</param> /// <param name="guid">GUID.</param> /// <param name="filterCatalog">Filter catalog.</param> /// <param name="filterSchema">Filter schema.</param> /// <param name="filterName">Name of the filter.</param> /// <param name="filterType">Filter type.</param> /// <returns></returns> public DataTable GetOleDbSchema(Adapdev.IProgressCallback _callback, string oledbConnectionString, Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { DataTable schemaTable = null; OleDbConnection conn = new OleDbConnection(oledbConnectionString); conn.Open(); try { schemaTable = conn.GetOleDbSchemaTable(guid, GetFilters(guid, filterCatalog, filterSchema, filterName, filterType)); } catch (Exception ex) { if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Critical, "Error obtaining Schema Information: " + ex.Message); } conn.Close(); return schemaTable; }