CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of DbDataReader
C#
/// <summary>
/// Creates a list of a given type from all the rows in a DataReader.
/// 
/// Note this method uses Reflection so this isn't a high performance
/// operation, but it can be useful for generic data reader to entity
/// conversions on the fly and with anonymous types.
/// </summary>
/// <typeparam name="TType"></typeparam>
/// <param name="reader">An open DataReader that's in position to read</param>
/// <param name="fieldsToSkip">Optional - comma delimited list of fields that you don't want to update</param>
by Rick Strahl   September 23, 2011 @ 3:26pm
825 Views
no comments
 
C#
using(OleDbConnection connection = new OleDbConnection(ConnectionString))
{
    using(OleDbCommand cmd = new OleDbCommand(sql, connection) { CommandType = CommandType.Text })
    { 
        try
        {
            connection.Open();
        }
        catch (OleDbException ex)
        {
by dereklawless   February 12, 2010 @ 6:25pm
187 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate