System.Data.Common.DbDataReader.GetSchemaTable()

Here are the examples of the csharp api class System.Data.Common.DbDataReader.GetSchemaTable() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

24 Examples 7

1. Example

Project: EDDiscovery
Source File: SQLiteCommandED.cs
View license
public override DataTable GetSchemaTable() { return InnerReader.GetSchemaTable(); }

2. Example

Project: Glimpse
Source File: GlimpseDbDataReader.cs
View license
public override DataTable GetSchemaTable()
        {
            return InnerDataReader.GetSchemaTable();
        }

3. Example

View license
public override DataTable GetSchemaTable()
            {
                return reader.GetSchemaTable();
            }

4. Example

Project: ALinq
Source File: AccessDbConnection.cs
View license
public override DataTable GetSchemaTable()
        {
            return source.GetSchemaTable();
        }

5. Example

Project: ALinq
Source File: DataReader.cs
View license
public override DataTable GetSchemaTable()
        {
            return source.GetSchemaTable();
        }

6. Example

Project: ALinq
Source File: Connection.cs
View license
public override DataTable GetSchemaTable()
        {
            return source.GetSchemaTable();
        }

7. Example

Project: ALinq
Source File: Connection.cs
View license
public override DataTable GetSchemaTable()
        {
            return source.GetSchemaTable();
        }

8. Example

Project: nhibernate-core
Source File: ResultSetWrapper.cs
View license
public override DataTable GetSchemaTable()
		{
			return rs.GetSchemaTable();
		}

9. Example

View license
public override DataTable GetSchemaTable()
		{
			return reader.GetSchemaTable();
		}

10. Example

View license
public override DataTable GetSchemaTable()
		{
			return _reader.GetSchemaTable();
		}

11. Example

Project: NServiceKit
Source File: ProfiledDbDataReader.cs
View license
public override DataTable GetSchemaTable()
        {
            return _reader.GetSchemaTable();
        }

12. Example

View license
public override DataTable GetSchemaTable()
        {
            return wrappedReader.GetSchemaTable();
        }

13. Example

View license
public override DataTable GetSchemaTable()
        {
            return _lazySchemaTable != null ? _lazySchemaTable.Value : _resultsReader.GetSchemaTable();
        }

14. Example

View license
public override DataTable GetSchemaTable()
        {
            return this.wrappedDataReader.GetSchemaTable();
        }

15. Example

Project: linq2db
Source File: DataProviderBase.cs
View license
public virtual bool? IsDBNullAllowed(IDataReader reader, int idx)
		{
#if !NETSTANDARD
			var st = ((DbDataReader)reader).GetSchemaTable();
			return st == null || st.Rows[idx].IsNull("AllowDBNull") || (bool)st.Rows[idx]["AllowDBNull"];
#else
			return true;
#endif
		}

16. Example

Project: nhibernate-core
Source File: Loader.cs
View license
private ColumnNameCache RetreiveColumnNameToIndexCache(DbDataReader rs)
		{
			if (_columnNameCache == null)
			{
				Log.Debug("Building columnName->columnIndex cache");
				_columnNameCache = new ColumnNameCache(rs.GetSchemaTable().Rows.Count);
			}

			return _columnNameCache;
		}

17. Example

View license
private static IEnumerable<string> GetColumnNames(DbDataReader reader)
        {
            List<string> columnNames = new List<string>();
            foreach (DataRow r in reader.GetSchemaTable().Rows)
            {
                columnNames.Add(r[SchemaTableColumn.ColumnName].ToString());
            }

            return columnNames;
        }

18. Example

Project: elastic-db-tools
Source File: Program.cs
View license
private static IEnumerable<string> GetColumnNames(DbDataReader reader)
        {
            List<string> columnNames = new List<string>();
            foreach (DataRow r in reader.GetSchemaTable().Rows)
            {
                columnNames.Add(r[SchemaTableColumn.ColumnName].ToString());
            }

            return columnNames;
        }

19. Example

Project: AntData.ORM
Source File: DataProviderBase.cs
View license
public virtual bool? IsDBNullAllowed(IDataReader reader, int idx)
        {
#if !NETSTANDARD
			var st = ((DbDataReader)reader).GetSchemaTable();
            return st == null || st.Rows[idx].IsNull("AllowDBNull") || (bool)st.Rows[idx]["AllowDBNull"];
            //return st == null || (bool)st.Rows[idx]["AllowDBNull"];
#else
            return true;
#endif
        }

20. Example

View license
private void InitSchemaTemplate(DbDataReader templateReader)
        {
            _schemaComparisonTemplate = templateReader.GetSchemaTable().Copy();
            _finalSchemaTable = templateReader.GetSchemaTable().Copy();

            if (_hasShardIdPseudoColumn)
            {
                AddShardIdPseudoColumnRecordToSchemaTable();
            }
        }

21. Example

View license
private void ValidateReaderSchema(LabeledDbDataReader labeledReader)
        {
            Contract./n ..... /n //View Source file for more details /n }

22. Example

Project: nhibernate-core
Source File: NDataReader.cs
View license
internal static async Task<NResult> CreateAsync(DbDataReader reader, bool isMidstream, CancellationToken cancellationToken)
			{
				cancellationToken.ThrowIfCancellationRequested();
				var result = new NResult
				{
					schemaTable = reader.GetSchemaTable()
				};

				List<object[]> recordsList = new List<object[]>();
				int rowIndex = 0;

				// if we are in the middle of processing the reader then don't bother
				// to move to the next record - just use the current one.
				while (isMidstream || await (reader.ReadAsync(cancellationToken)).ConfigureAwait(false))
				{
					if (rowIndex == 0)
					{
						for (int i = 0; i < reader.FieldCount; i++)
						{
							string fieldName = reader.GetName(i);
							result.fieldNameToIndex[fieldName] = i;
							result.fieldIndexToName.Add(fieldName);
							result.fieldTypes.Add(reader.GetFieldType(i));
							result.fieldDataTypeNames.Add(reader.GetDataTypeName(i));
						}

						result.colCount = reader.FieldCount;
					}

					rowIndex++;

					object[] colValues = new object[reader.FieldCount];
					reader.GetValues(colValues);
					recordsList.Add(colValues);

					// we can go back to reading a reader like normal and don't need
					// to consider where we started from.
					isMidstream = false;
				}

				result.records = recordsList.ToArray();
				return result;
			}

23. Example

Project: nhibernate-core
Source File: NDataReader.cs
View license
internal static NResult Create(DbDataReader reader, bool isMidstream)
			{
				var result = new NResult
				{
					schemaTable = reader.GetSchemaTable()
				};

				List<object[]> recordsList = new List<object[]>();
				int rowIndex = 0;

				// if we are in the middle of processing the reader then don't bother
				// to move to the next record - just use the current one.
				while (isMidstream || reader.Read())
				{
					if (rowIndex == 0)
					{
						for (int i = 0; i < reader.FieldCount; i++)
						{
							string fieldName = reader.GetName(i);
							result.fieldNameToIndex[fieldName] = i;
							result.fieldIndexToName.Add(fieldName);
							result.fieldTypes.Add(reader.GetFieldType(i));
							result.fieldDataTypeNames.Add(reader.GetDataTypeName(i));
						}

						result.colCount = reader.FieldCount;
					}

					rowIndex++;

					object[] colValues = new object[reader.FieldCount];
					reader.GetValues(colValues);
					recordsList.Add(colValues);

					// we can go back to reading a reader like normal and don't need
					// to consider where we started from.
					isMidstream = false;
				}

				result.records = recordsList.ToArray();
				return result;
			}

24. Example

Project: nuodb-dotnet
Source File: SQLEditor.cs
View license
private void ExecuteCommand(string cmd)
        {
            DbCommand dbCmd = _connection.CreateCo/n ..... /n //View Source file for more details /n }