Converting List To IDataReader

I wrote about using SqlBulkCopy to fast load data from .NET into SQL Server database. This class needs a DataTable or IDataReader instance as a source. You can convert a C# List to DataTable (look here Converting List To DataTable). Now I’ll show a couple of examples how to convert List to IDataReader.

1. Straight implementation of IDataReader interface
I’ve seen a couple of good examples from Bruce Dunwiddie https://www.csvreader.com/posts/GenericListDataReader.cs and Venu Gopal http://technico.qnownow.com/custom-data-reader-to-bulk-copy-data-from-object-collection-to-sql-server/. Based on these two solutions I’ve made my one.

Now you can iterate through IDataReader like you do with SqlDataReader.

2. FastMember NuGet package

Thank you, Marc! it’s a good job https://github.com/mgravell/fast-member

You need to install NuGet package FastMember, add using FastMember; statement, and run this code.

Slide Decks and Demos for #sqlweek 2015

Here are my presentations and demo scripts/projects that were used on my sessions on SQL Saturdays or user group meetings during my #sqlweek from August 29 till September 5, 2015.

Slide decks (in chronological order):

29.08.2015 SQL Sat Oslo, Norway – Transaction Log Internals and Troubleshooting

31.08.2015 Wroclaw, Poland – Transaction Log Internals and Troubleshouting

01.09.2015 Copenhagen, Denmark – Visual Studio for SQL developers

02.09.2015 Gent, Belgium – Visual Studio for SQL developers

03.09.2015 Berlin, Germany – Visual Studio for SQL developers

03.09.2015 Berlin, Germany – Transaction Log Internals and Troubleshooting

05.09.2015 SQLSat Goteborg, Sweden – Transaction Log Internals and Troubleshooting

 

Demo files for the session “Transaction Log Internals and Troubleshooting”:

Demo – Transaction log internals and troubleshooting

Demo files for the session “Visual Studio for SQL Developers”:

ClientsDB_setup

ClientsDBSolution

 

My #sqlweek 2015 with PASS Europe

It’s just 2 weeks before my fantastic #sqlweek, the grand tour in Europe that will last from one SQL Saturday to another SQL Saturday. But the days between them won’t be less amazing.

To say shortly, I’ll cross 7 countries, speak at 2 SQL Saturday conferences and 4 user group meetings. The schedule will be very intensive:

  • Saturday, August 29 – SQL Saturday Oslo
  • Monday, August 31 – Wroclaw, Poland
  • Tuesday, September 1 – Copenhagen, Denmark
  • Wednesday, September 2 – Gent, Belgium
  • Thursday, September 3 – Berlin, Germany
  • Saturday, September 5 – SQL Saturday Göteborg, Sweden

The only exception from this list is Paris, France, where I’ll spend a night waiting for a flight to my home.

That will be a hard week full of meetings, presentations, transfers and changing places. Almost every day I’ll have an air flight to reach the next point. From the other side, it will bring a lot of new impressions, the acquaintance with ancient European cities, and new friends. Even these days are the days of my vacation for this year, I suppose it will a very good time. And I hope I’ll never regret that I’m trying to do something unusual, something exciting.

I’d like to say some kind words to all who organizes these conferences and meetings. Without you, without your response, your help and advice I could not make such a cool tour in one week.

Also I want to thank SQL PASS and its leaders for their energy. Without PASS, all PASS events and PASS groups and societies it will be extremely hard to find a way to communicate with a foreign colleagues to organize meetings. It’s great that I’m a part of PASS movement, and this participation also helps me to make something great.