示例#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);
        }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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);
            }
        }
示例#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);
            }
        }
示例#6
0
 public abstract DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting);
示例#7
0
 protected abstract DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError);
示例#8
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     return(GetSchemaTable(tableOrView.GetSql(identifierQuoting)));
 }
示例#9
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     throw new NotImplementedException();
 }
示例#10
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, IdentifierQuoting identifierQuoting, out bool isError)
 {
     throw new NotImplementedException();
 }
示例#11
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView, IdentifierQuoting identifierQuoting)
 {
     return(GetSchemaTable(tableOrView.GetSql(identifierQuoting, false, UseThreePartName)));
 }
示例#12
0
 public abstract DataTable GetSchemaTable(SchemaNode tableOrView);
示例#13
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     return(GetSchemaTable(tableOrView.GetSql()));
 }
示例#14
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     throw new NotImplementedException();
 }
示例#15
0
 public override DataTable GetSchemaTable(SchemaNode tableOrView)
 {
     return(GetSchemaTable(tableOrView.GetSql(false, UseThreePartName)));
 }
示例#16
0
 protected override DataTable InternalGetSampleData(SchemaNode tableOrView, RowLimitClause rowLimitClause, out bool isError)
 {
     throw new NotSupportedException();
 }