<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6436036042271330428</id><updated>2011-07-08T20:46:31.933+10:00</updated><category term='Benchmark'/><category term='SQLServer'/><category term='Fluent Spring Spring.NET'/><category term='SqlBulkCopy'/><title type='text'>DotNet Padawan</title><subtitle type='html'>Explore, Learn and Share</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wiryadi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://wiryadi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wiryadi Adidharma</name><uri>http://www.blogger.com/profile/17413013719684399669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp1.blogger.com/_E-mpUjcusSk/R1_AZhv26fI/AAAAAAAAABA/Qgu5I4P5TFY/S220/dilbert-fencing.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6436036042271330428.post-5452116135676915756</id><published>2010-07-05T21:02:00.007+10:00</published><updated>2010-07-05T22:20:04.034+10:00</updated><title type='text'>C# 4.0 Dynamic and Expando</title><content type='html'>The most exciting C# 4.0 feature for me is the dynamic.&lt;br /&gt;It significantly lowered the cost to create more fluent and beautiful API.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below is the slide from my lightning talk at Sydney ALT.NET June meeting.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.slideshare.net/wiryadi/c-40-dynamic"&gt;http://www.slideshare.net/wiryadi/c-40-dynamic&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The source code for CoolSQL will be available on GitHub &lt;br /&gt;&lt;a href="http://github.com/wiryadi/DynamicSQL"&gt;&lt;br /&gt;http://github.com/wiryadi/DynamicSQL&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6436036042271330428-5452116135676915756?l=wiryadi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wiryadi.blogspot.com/feeds/5452116135676915756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6436036042271330428&amp;postID=5452116135676915756' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/5452116135676915756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/5452116135676915756'/><link rel='alternate' type='text/html' href='http://wiryadi.blogspot.com/2010/07/c-40-dynamic-and-expando.html' title='C# 4.0 Dynamic and Expando'/><author><name>Wiryadi Adidharma</name><uri>http://www.blogger.com/profile/17413013719684399669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp1.blogger.com/_E-mpUjcusSk/R1_AZhv26fI/AAAAAAAAABA/Qgu5I4P5TFY/S220/dilbert-fencing.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6436036042271330428.post-1100669919610951120</id><published>2008-10-23T22:59:00.003+11:00</published><updated>2008-10-23T23:03:51.392+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fluent Spring Spring.NET'/><title type='text'>Fluent Spring is Alive</title><content type='html'>Fluent Spring project is alive. It is hosted at google code.&lt;br /&gt;It is still very rough. &lt;br /&gt;&lt;br /&gt;The project delivers DSL to configure Spring.NET in C#, no XML required.&lt;br /&gt;&lt;br /&gt;Check it out at &lt;a href="http://code.google.com/p/fluent-spring"&gt;http://code.google.com/p/fluent-spring&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6436036042271330428-1100669919610951120?l=wiryadi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://code.google.com/p/fluent-spring' title='Fluent Spring is Alive'/><link rel='replies' type='application/atom+xml' href='http://wiryadi.blogspot.com/feeds/1100669919610951120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6436036042271330428&amp;postID=1100669919610951120' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/1100669919610951120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/1100669919610951120'/><link rel='alternate' type='text/html' href='http://wiryadi.blogspot.com/2008/10/fluent-spring-is-alive.html' title='Fluent Spring is Alive'/><author><name>Wiryadi Adidharma</name><uri>http://www.blogger.com/profile/17413013719684399669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp1.blogger.com/_E-mpUjcusSk/R1_AZhv26fI/AAAAAAAAABA/Qgu5I4P5TFY/S220/dilbert-fencing.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6436036042271330428.post-3883855612703927012</id><published>2008-10-15T16:32:00.004+11:00</published><updated>2008-10-15T16:49:55.224+11:00</updated><title type='text'>Spring.NET fluent configuration</title><content type='html'>&lt;h2&gt;Mission&lt;/h2&gt;&lt;br /&gt;I like Spring.NET framework. But I am not a fan of xml configuration.&lt;br /&gt;&lt;br /&gt;Spring.NET has programmatic configuration API. &lt;a href="http://blog.springsource.com/2008/01/04/spring-net-11-and-container-configuration/"&gt;Refer to Mark Pollack's blog&lt;/a&gt;&lt;br /&gt;However, the api is awkward to work with.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Plan&lt;/h2&gt;I like the way&lt;a style="font-family: arial;" href="http://code.google.com/p/autofac/"&gt;Autofac's&lt;/a&gt; fluent configuration.&lt;br /&gt;I plan to create a helper class to provide fluent configuration for Spring.NET a'la Autofac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6436036042271330428-3883855612703927012?l=wiryadi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wiryadi.blogspot.com/feeds/3883855612703927012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6436036042271330428&amp;postID=3883855612703927012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/3883855612703927012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/3883855612703927012'/><link rel='alternate' type='text/html' href='http://wiryadi.blogspot.com/2008/10/springnet-fluent-configuration.html' title='Spring.NET fluent configuration'/><author><name>Wiryadi Adidharma</name><uri>http://www.blogger.com/profile/17413013719684399669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp1.blogger.com/_E-mpUjcusSk/R1_AZhv26fI/AAAAAAAAABA/Qgu5I4P5TFY/S220/dilbert-fencing.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6436036042271330428.post-6106329013550629432</id><published>2007-08-05T00:08:00.000+10:00</published><updated>2007-12-13T22:12:13.894+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SqlBulkCopy'/><category scheme='http://www.blogger.com/atom/ns#' term='Benchmark'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>Benchmarking SqlBulkCopy</title><content type='html'>Bulk uploading into SQL Server programmatically has always been slow and tedious exercise.&lt;br /&gt;Fortunately  Microsoft has included SqlBulkCopy in the SqlClient for ADO.NET 2.0&lt;br /&gt;&lt;br /&gt;In my testing. I loaded Australia's PostCode list from csv file,  consisting of 16,789 rows.&lt;br /&gt;I compared SqlAdapter.Fill(),  SqlAdapterFill() + Setting the UpdateBatchSize property, and finally I used SqlBulkCopy.&lt;br /&gt;&lt;br /&gt;First I read the csv file into in memory DataTable. For this purpose I read all rows in one go. In real live application, we would need to page the operation.&lt;br /&gt;&lt;br /&gt;Then I push the DataTable into SqlServer 2005  table using 3 different methods.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;SqlAdapter.Fill&lt;/li&gt;&lt;li&gt;SqlAdapter.Fill + Setting the UpdateBatchSize property = 500&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SqlBulkCopy&lt;/li&gt;&lt;/ol&gt;Option 1 took 11,365 ms&lt;br /&gt;Option 2 took 9,636 ms&lt;br /&gt;and .....&lt;br /&gt;Option 3 took 568 ms&lt;br /&gt;&lt;br /&gt;Wow,.....&lt;br /&gt;I suspect that option 1 and option 2 difference would be more significant if the SQL Server is located accross network. In this test I use local SQL Server.&lt;br /&gt;&lt;br /&gt;To do SqlBulkCopy  is surprisingly simple:&lt;br /&gt;You need only to specify the connection string, the datatable and the name of the destination table.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    string connectionString = "....";&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;   DataTable csvTable = PopulateTable();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    SqlBulkCopy bcp = new SqlBulkCopy(connectionString );&lt;br /&gt;bcp.DestinationTableName = "PostCodes";&lt;br /&gt;bcp.WriteToServer(csvTable);&lt;br /&gt;&lt;br /&gt;Here are snippet of the code from my Benchmark Harness, which is a winforms application&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_E-mpUjcusSk/RrSj0sZGxUI/AAAAAAAAAA0/x-L7r55Z4sg/s1600-h/code1.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_E-mpUjcusSk/RrSj0sZGxUI/AAAAAAAAAA0/x-L7r55Z4sg/s400/code1.png" alt="" id="BLOGGER_PHOTO_ID_5094877204127860034" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6436036042271330428-6106329013550629432?l=wiryadi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wiryadi.blogspot.com/feeds/6106329013550629432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6436036042271330428&amp;postID=6106329013550629432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/6106329013550629432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6436036042271330428/posts/default/6106329013550629432'/><link rel='alternate' type='text/html' href='http://wiryadi.blogspot.com/2007/08/benchmarking-sqlbulkcopy.html' title='Benchmarking SqlBulkCopy'/><author><name>Wiryadi Adidharma</name><uri>http://www.blogger.com/profile/17413013719684399669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp1.blogger.com/_E-mpUjcusSk/R1_AZhv26fI/AAAAAAAAABA/Qgu5I4P5TFY/S220/dilbert-fencing.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_E-mpUjcusSk/RrSj0sZGxUI/AAAAAAAAAA0/x-L7r55Z4sg/s72-c/code1.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
