Skip to header Skip to main navigation Skip to main content Skip to footer

User account menu

  • Log in
Amaël BERTEAU
Software Craftsman & Maker

Main navigation

  • Home
  • News
  • Software Engineering
  • Maker
  • Entrepreneuriat
  • Misc
  • Personal Projects
    • Bio
    • Curriculum Vitae
    • Skills
    • Likes
    • My Values
    • Quotes
    • Favorite Books
    • Favorite Tools

Extension methods around DataRecord (DbNull and column name support)

Breadcrumb

  • Home
  • Software Engineering
  • Extension methods around DataRecord (DbNull and column name support)

Software Engineering

  • Agile
  • Concepts / Practices
  • Architecture / Design
  • Implementation
  • Tools
    • FR
    • EN
By aberteau | 12:40 AM CEST, Wed July 26, 2017

Extension methods around DataRecord (DbNull and column name support)

IDataRecord Interface

namespace : System.Data

Provides access to the column values within each row for a DataReader, and is implemented by .NET Framework data providers that access relational databases.

2 observations :

  • methods take colum index as parameter. (GetInt32(Int32), GetInt64(Int32), ...)
  • we must check if the specified field is set to null before retrieve value (dataRecord.IsDBNull(colIndex) ou dataRecord[columnName] == DBNull.Value)

Needs

  • methods that provide access to the column value by name (GetInt32(String), GetInt64(String), ...)
  • Nullable type to handle DbNull

DataRecordExtensions

SqlClient
.Net

Footer menu

  • Contact

Copyright © 2026 Amael BERTEAU - All rights reserved