Oct 21 2008

Mapping and Importing Excel Files to a Database using SqlBulkCopy

Problem:
I was working on a project this week that involved importing data from excel spreadsheets into a SQL database. At first glance I thought no problem, just load the excel document into a DataTable and use SqlBulkCopy to import. Easy enough I thought, but then I was informed that each of these excel files will have different header name and in some cases they will include extra columns. Damn! It’s never that easy.  I started looking around for the best way to accomplish this and this is what I pieced together.

Solution:

  1. Get the table scheme for the Excel and DB table
  2. Map the columns
  3. Load Excel data into DataTable
  4. Use SQLBulkCopy to import in to the DB
  5. Boom Done!

Continue reading


Oct 19 2008

Reduce Flex 3 File Size by Framework Cache and Export Release

I attended my first Chicago Flex User Group this week, which had guess speaker Kevin Hoyt from Adobe.  Even though the main focus of the presentation was about styling and skinning Flex applications, a conversation about file size sparked my interest.  In Flex 3 you can do two things to help decrease the size of your application.

Continue reading