14 Haziran 2013 Cuma

checking data reader is null

using System;

public static class DataReaderExtensions
{
    public static bool IsDBNull(this IDataReader dataReader, string columnName)
    {
        return dataReader[columnName] == DBNull.Value;
    }
}

by this extension method you can check datareader column whether null or not

Hiç yorum yok:

Yorum Gönder

evren pehlivan yazılım

evren pehlivan yazılım, evren pehlivan yazılım geliştirici