Example #1
0
        public DataTable GetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError)
        {
            var result = InternalGetSampleData(tableOrView, rowLimitClause, identifierQuoting, out isError);

            tableOrView.LoadColumnsFromSample(result);
            return(result);
        }
Example #2
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, out bool isError)
 {
     try
     {
         var sql     = GetSampleSql(rowLimitClause, (UseThreePartName ? tableOrView.ThreePartName : tableOrView.DisplayName), 200);
         var adapter = new System.Data.OleDb.OleDbDataAdapter(sql, ProviderString);
         adapter.SelectCommand.CommandTimeout = 30;
         var result = new DataTable();
         adapter.Fill(0, 200, result);
         isError = false;
         return(result);
     }
     catch (Exception ex)
     {
         ErrorTable.Rows[0][0] = ex.Message;
         isError = true;
         return(ErrorTable);
     }
 }
Example #3
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError)
 {
     try
     {
         var sql     = GetSampleSql(rowLimitClause, tableOrView.GetRef(identifierQuoting, false), 200);
         var adapter = new System.Data.Odbc.OdbcDataAdapter(sql, ProviderString);
         adapter.SelectCommand.CommandTimeout = 30;
         var result = new DataTable();
         adapter.Fill(0, 200, result);
         isError = false;
         return(result);
     }
     catch (Exception ex)
     {
         ErrorTable.Rows[0][0] = ex.Message;
         isError = true;
         return(ErrorTable);
     }
 }
Example #4
0
        protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError)
        {
            try
            {
                var csb     = new SC.SqlConnectionStringBuilder(ProviderString);
                var adapter = new SC.SqlDataAdapter($"SELECT TOP 200 * FROM {tableOrView.GetRef(identifierQuoting, UseThreePartName)}" + (rowLimitClause == RowLimitClause.Top ? " WITH (NOLOCK)" : ""), csb.ConnectionString);
                adapter.SelectCommand.CommandTimeout = 30;

                var result = new DataTable();
                adapter.Fill(0, 200, result);
                isError = false;
                return(result);
            }
            catch (Exception ex)
            {
                ErrorTable.Rows[0][0] = ex.Message;
                isError = true;
                return(ErrorTable);
            }
        }
Example #5
0
        protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, out bool isError)
        {
            try
            {
                var csb     = new System.Data.SqlClient.SqlConnectionStringBuilder(ProviderString);
                var adapter = new System.Data.SqlClient.SqlDataAdapter($"SELECT TOP 200 * FROM {(UseThreePartName ? tableOrView.ThreePartName : tableOrView.DisplayName)} WITH (NOLOCK)", csb.ConnectionString);
                adapter.SelectCommand.CommandTimeout = 30;

                var result = new DataTable();
                adapter.Fill(0, 200, result);
                isError = false;
                return(result);
            }
            catch (Exception ex)
            {
                ErrorTable.Rows[0][0] = ex.Message;
                isError = true;
                return(ErrorTable);
            }
        }
Example #6
0
 public abstract DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting);
Example #7
0
 protected abstract DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError);
Example #8
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     return(GetSchemaTable(tableOrView.GetSql(identifierQuoting)));
 }
Example #9
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     throw new NotImplementedException();
 }
Example #10
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError)
 {
     throw new NotImplementedException();
 }
Example #11
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     return(GetSchemaTable(tableOrView.GetSql(identifierQuoting, false, UseThreePartName)));
 }
Example #12
0
 public abstract DataTable GetSchemaTable(SchemaNode tableOrView);
Example #13
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     return(GetSchemaTable(tableOrView.GetSql()));
 }
Example #14
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     throw new NotImplementedException();
 }
Example #15
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     return(GetSchemaTable(tableOrView.GetSql(false, UseThreePartName)));
 }
Example #16
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, out bool isError)
 {
     throw new NotSupportedException();
 }