protected void CheckSettingsAndFirstRow(DataTable dt, SettingsIndexResultSet settings) { if (dt.Rows.Count == 0) { return; } var dr = dt.Rows[0]; for (int i = 0; i < dr.Table.Columns.Count; i++) { CheckSettingsFirstRowCell( settings.GetColumnRole(i) , settings.GetColumnType(i) , dr.Table.Columns[i] , dr.IsNull(i) ? DBNull.Value : dr[i] , new string[] { "The column with index '{0}' is expecting a numeric value but the first row of your result set contains a value '{1}' not recognized as a valid numeric value or a valid interval." , " Aren't you trying to use a comma (',' ) as a decimal separator? NBi requires that the decimal separator must be a '.'." , "The column with index '{0}' is expecting a 'date & time' value but the first row of your result set contains a value '{1}' not recognized as a valid date & time value." } ); } }
protected void WriteSettingsToDataTableProperties(DataTable dt, SettingsIndexResultSet settings) { foreach (DataColumn column in dt.Columns) { WriteSettingsToDataTableProperties( column , settings.GetColumnRole(column.Ordinal) , settings.GetColumnType(column.Ordinal) , settings.GetTolerance(column.Ordinal) , settings.GetRounding(column.Ordinal) ); } }