<?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-4262104506010732791</id><updated>2011-11-27T23:29:09.036Z</updated><category term='cdosys eml attachments'/><title type='text'>David's ASP.NET curiosities</title><subtitle type='html'>The results of several years' experience hacking websites together using ASP.NET, MySQL, VB.NET, C# and JavaScript.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-5963677703162637818</id><published>2010-12-17T10:29:00.003Z</published><updated>2010-12-29T20:23:56.295Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='cdosys eml attachments'/><title type='text'>Can't find all the attachments in .EML file?</title><summary type='text'>Using CDOSYS.DLL is a very convenient way to parse and extract content and attachments from an EML file. However, embedded images in the HTML part of the email do not appear as attachments.

Solution: enumerate the BodyParts and look for BodyParts with a filename: this includes all the attachments and embedded images.  The syntax is a little tricky, but BodyParts work just the same as Attachments</summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/5963677703162637818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/12/cant-find-all-attachments-in-eml-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/5963677703162637818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/5963677703162637818'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/12/cant-find-all-attachments-in-eml-file.html' title='Can&apos;t find all the attachments in .EML file?'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-4376798260784608085</id><published>2010-12-17T10:23:00.003Z</published><updated>2011-01-09T16:43:12.972Z</updated><title type='text'>MySQL Restore fails with 'Server gone away'</title><summary type='text'>Most probably due to the default value of 1M for max_allowed_packet.  Increase to 100M and problem will very likely go away.</summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/4376798260784608085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/12/mysql-restore-fails-with-server-gone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4376798260784608085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4376798260784608085'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/12/mysql-restore-fails-with-server-gone.html' title='MySQL Restore fails with &apos;Server gone away&apos;'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-384474341549139468</id><published>2010-11-20T21:18:00.002Z</published><updated>2010-11-23T09:12:03.941Z</updated><title type='text'>Reading EML files</title><summary type='text'>You can do this 'properly' (certainly better than trying to parse it as a text file) by using the COM cdosys.dll ('Microsoft CDO for Windows 2000 Library').

You'll need to create a .Net wrapper for it by adding a reference: because it depends on ADODB.dll, you'll get Interop.CDO.dll and Interop.ADODB.dll created for you in your bin directory.

There's a lot of information around for sending </summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/384474341549139468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/11/reading-eml-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/384474341549139468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/384474341549139468'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/11/reading-eml-files.html' title='Reading EML files'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-8187840742495162765</id><published>2010-08-31T11:43:00.021+01:00</published><updated>2010-08-31T13:07:47.918+01:00</updated><title type='text'>Using MySql with WebMatrix</title><summary type='text'>There's a small problem that affects any attempt to connect to a database through a connection string using WebMatrix : there's an error in the documentation that leads you to try to use Database.OpenConnectionString when you should be using the currently undocumented Database.Open (as shown below).
If you install the MySql.Data.MySqlClient dll to the GAC then you won't need the </summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/8187840742495162765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/using-mysql-with-webmatrix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/8187840742495162765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/8187840742495162765'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/using-mysql-with-webmatrix.html' title='Using MySql with WebMatrix'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-6675896724076201533</id><published>2010-08-29T12:28:00.001+01:00</published><updated>2010-08-29T12:29:44.991+01:00</updated><title type='text'>Export GridView to Excel</title><summary type='text'>After researching this for some time I found an excellent article that provides a convenient  solution from Matt Berseth: http://mattberseth.com/blog/2007/04/export_gridview_to_excel_1.html

Like most solutions to this problem, this article describes how to make ASP.NET re-render the GridView in a cleaned-up HTML format and then serve that rendering as a download.  The downside to this is that it</summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/6675896724076201533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/export-gridview-to-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/6675896724076201533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/6675896724076201533'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/export-gridview-to-excel.html' title='Export GridView to Excel'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-4169929666977888587</id><published>2010-08-27T15:29:00.009+01:00</published><updated>2010-11-26T10:07:26.991Z</updated><title type='text'>ASP.NET and the annoying DropDownList problem...</title><summary type='text'>'ddlxxxxx' has a SelectedValue which is invalid because it does not exist in the list of items.Many people complain about this untrappable error, but if you search hard enough, you will eventually find the fix: http://forums.devx.com/showthread.php?t=155180


So, it turns out that it's very easy to create your own DropDownList control inheriting all the behaviour of the original except this error</summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/4169929666977888587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/aspnet-and-annoying-dropdownlist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4169929666977888587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4169929666977888587'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/aspnet-and-annoying-dropdownlist.html' title='ASP.NET and the annoying DropDownList problem...'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4262104506010732791.post-4704545905761441263</id><published>2010-08-27T11:16:00.001+01:00</published><updated>2010-08-27T11:26:16.687+01:00</updated><title type='text'>ASP.NET, databases, localization and the problem with Turkish...</title><summary type='text'>This is one of the craziest problems ever:

1. You have a database field called 'CustomerId'
2. so you refer to this field as myrow("CustomerId")
3. this works for all users worldwide but fails for Turkish users
4. change the code to refer to myrow("Customerid") and it works

Reason:  Turkish has an i character without a dot. 

So, in Turkish, 'i' and 'I' are not related in any way: they are not </summary><link rel='replies' type='application/atom+xml' href='http://dturnerblog.blogspot.com/feeds/4704545905761441263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/aspnet-databases-localization-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4704545905761441263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4262104506010732791/posts/default/4704545905761441263'/><link rel='alternate' type='text/html' href='http://dturnerblog.blogspot.com/2010/08/aspnet-databases-localization-and.html' title='ASP.NET, databases, localization and the problem with Turkish...'/><author><name>David</name><uri>http://www.blogger.com/profile/01511239714035057094</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
