C# DBNull and nullable Types – cleanest form of conversion

The LINQ to DataSets chapter of LINQ in Action is a good read.

One thing you’ll see is the Field<T> extension method, which is used as follows:-

int? x = dr.Field<int?>( "Field" );

Or

int y = dr.Field<int?>( "Field" ) ?? 0;

Or

var z = dr.Field<int?>( "Field" );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)