Exemple #1
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);
     }
 }
Exemple #2
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);
            }
        }