<?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-13117585</id><updated>2011-04-21T11:58:41.616-07:00</updated><title type='text'>Sector 23 - CodeBank</title><subtitle type='html'>Code in C# and .NET to make my life easier next month when I've forgotten how to do it.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13117585.post-113502004944516355</id><published>2005-12-19T11:20:00.000-08:00</published><updated>2005-12-19T11:20:49.480-08:00</updated><title type='text'>The CodeBank has moved!</title><content type='html'>I'm now using the DataBrowser at &lt;a href="http://www.atakala.com/Browser/Item.aspx?user_id=amos"&gt;http://www.atakala.com/Browser/Item.aspx?user_id=amos&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've found that the blog mode is no good for what I'm doing here, I needed a site that supported "encyclopedia mode" instead.&lt;br /&gt;&lt;br /&gt;Come check it out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-113502004944516355?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/113502004944516355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=113502004944516355' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/113502004944516355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/113502004944516355'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/12/codebank-has-moved.html' title='The CodeBank has moved!'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13117585.post-112863288877760271</id><published>2005-10-06T14:01:00.000-07:00</published><updated>2005-10-06T14:09:27.240-07:00</updated><title type='text'>Color the Background of a C# TabControl</title><content type='html'>To set the color of a tabControl to something other than 'Control', set the DrawMode property on the tabControl.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;DrawMode = OwnerDrawFixed.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Then, handle the DrawItem event; you will need to draw the tab text yourself, as well as optionally setting the background color.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)&lt;br /&gt;{&lt;br /&gt;string tabName = this.tabControl1.TabPages[e.Index].Text;&lt;br /&gt;StringFormat sf = new StringFormat();&lt;br /&gt;sf.Alignment = StringAlignment.Center;&lt;br /&gt;Rectangle centerRect = new Rectangle(e.Bounds.X+3,e.Bounds.Y+3,e.Bounds.Width-6,e.Bounds.Height-3);&lt;br /&gt;e.Graphics.FillRectangle(Brushes.WhiteSmoke, centerRect); // colors the tab caption&lt;br /&gt;e.Graphics.DrawString("Filter", new Font("Arial", 9, FontStyle.Regular),System.Drawing.Brushes.Black, centerRect, sf);&lt;br /&gt;} // load&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;Since this only colors the actual tab captions, you need to color each tab page the same color as here. Do this by setting the BackColor of each tab page to the color you used here.&lt;br /&gt;&lt;br /&gt;Note that we only colored an area excluding a 3px border. This is because the tabPages have, by default, a 3px border around them, so our tab captions need to match that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112863288877760271?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112863288877760271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112863288877760271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112863288877760271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112863288877760271'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/10/color-background-of-c-tabcontrol.html' title='Color the Background of a C# TabControl'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112708654268451981</id><published>2005-09-18T16:32:00.000-07:00</published><updated>2005-09-18T16:35:42.696-07:00</updated><title type='text'>Add Prompt on C# Webpage</title><content type='html'>When a user clicks a button, you probably want to confirm that they meant to click it.  Especially if the button's Text is "Delete Database".  Here's about the simplest check you could do:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;myDeleteButton.Attributes.Add("onClick", "return confirm('Are you sure you wish to delete the database?');");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;The user will see "Ok" and "Cancel".  If the user doesn't choose 'Ok', the operation is canceled.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112708654268451981?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112708654268451981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112708654268451981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112708654268451981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112708654268451981'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/09/add-prompt-on-c-webpage.html' title='Add Prompt on C# Webpage'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112689899131429128</id><published>2005-09-16T12:21:00.000-07:00</published><updated>2005-09-16T15:12:45.100-07:00</updated><title type='text'>Alternating Color on Crosstab Rows</title><content type='html'>In Crystal Reports 8.5 it "isn't possible" to alternate row color on a CrossTab. However, as usual with Crystal, there are plenty of workarounds.&lt;br /&gt;For me, most of my crosstabs always have the same number of rows, with variable numbers of fixed width columns.&lt;br /&gt;Workaround?&lt;br /&gt;Create a Picture which is a light grey box, and move it behind every other row. (Send to back.) Then, in the code that calls the report (C#/.NET), you can dynamically set the width of the box to match the number of columns you have:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;// set row shading width.&lt;br /&gt;foreach(CrystalDecisions.CrystalReports.Engine.ReportObject reportObj in report.reportDocument1.ReportDefinition.ReportObjects)&lt;br /&gt;{&lt;br /&gt;if(reportObj.Kind == CrystalDecisions.Shared.ReportObjectKind.PictureObject)&lt;br /&gt;{&lt;br /&gt;CrystalDecisions.CrystalReports.Engine.PictureObject box = (CrystalDecisions.CrystalReports.Engine.PictureObject)reportObj;&lt;br /&gt;box.Width = 1000+cols*500; //(label width + x for each column)&lt;br /&gt;}&lt;br /&gt;} // FORMAT lines&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;Note that you may be tempted to use a BoxObject, but setting the Width of a BoxObject dynamically is not allowed.  Also, make SURE you are decreasing the width of the picture box (put it on the report at maximum width).  Stretching the box doesn't seem to work.&lt;br /&gt;&lt;br /&gt;So theoretically, you could enhance this by dynamically creating (or moving) a series of pictures to handle the case of multiple rows as WELL as multiple columns. Good luck with that! I'll post it if I ever need to come up with the algorithm.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112689899131429128?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112689899131429128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112689899131429128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112689899131429128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112689899131429128'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/09/alternating-color-on-crosstab-rows.html' title='Alternating Color on Crosstab Rows'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112682423157305259</id><published>2005-09-15T15:32:00.000-07:00</published><updated>2005-09-15T15:43:59.220-07:00</updated><title type='text'>Changing Mailing Label Size in Crystal Reports</title><content type='html'>It's easy to create mailing labels using the Mailing Label Wizard in Crystal Reports. (8.5+, at least).&lt;br /&gt;But when you realize that you needed 1 inches instead of 2, how do you fix it without starting all over?&lt;br /&gt;It's simple enough, but certainly not intuitive. Open the Page Setup and enter the margins for your label sheet. Then, go to the Section Expert for the Detail section and choose the Layout Tab. Here you can change x, y, x-margin, y-margin, and the Across/Down order. Verify that the number of rows and columns are correct. You may need to delete extra whitespace around the detail section to get everything to add up.&lt;br /&gt;And that's it! : )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112682423157305259?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112682423157305259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112682423157305259' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112682423157305259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112682423157305259'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/09/changing-mailing-label-size-in-crystal.html' title='Changing Mailing Label Size in Crystal Reports'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13117585.post-112508583882934985</id><published>2005-08-26T12:48:00.000-07:00</published><updated>2005-08-26T12:50:38.833-07:00</updated><title type='text'>Error detected in export .dll - Crystal Reports</title><content type='html'>When exporting Crystal Reports to a .pdf format, the great error message "Error detected in export .dll" started popping up.  It took a while to track down, but the cause was this:&lt;br /&gt;An image field was on the report, but the data was null.  Worked fine in the viewer, but just not on the export.&lt;br /&gt;Solution: set "&lt;span style="font-size:85%;"&gt;Suppress"&lt;/span&gt; to &lt;span style="font-size:85%;"&gt;isnull(image_field_here).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112508583882934985?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112508583882934985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112508583882934985' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112508583882934985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112508583882934985'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/error-detected-in-export-dll-crystal.html' title='Error detected in export .dll - Crystal Reports'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13117585.post-112482530801696579</id><published>2005-08-23T12:21:00.000-07:00</published><updated>2005-08-23T12:28:28.020-07:00</updated><title type='text'>Testing SQL Code without cache - SQL Server</title><content type='html'>To find out how long a SQL query takes to run, you can't have the results already in the SQL Server cache.&lt;br /&gt;To clear the SQL cache, enter:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;DBCC DROPCLEANBUFFERS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are testing a stored procedure, clear the stored procedue cache by entering:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;DBCC FREEPROCCACHE&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112482530801696579?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112482530801696579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112482530801696579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112482530801696579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112482530801696579'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/testing-sql-code-without-cache-sql.html' title='Testing SQL Code without cache - SQL Server'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112448656117569267</id><published>2005-08-19T14:17:00.000-07:00</published><updated>2005-08-19T14:22:41.180-07:00</updated><title type='text'>The Big Red X - Nemesis of the Datagrid</title><content type='html'>Once you begin overriding the Paint methods for a datagrid, chances are you've run across the Big Red X.  And you've discovered that the only way to make it go away is to close the form/application and start over. &lt;br /&gt;It comes from a simple source... if an exception is thrown while the grid is being drawn, the grid is flagged as "bad", and the Big Red X comes to remind you that something went wrong.  Like you need to be told when your Paint methods aren't drawing correctly.  And, it doesn't go away until the control is completely destroyed.  (Alternatively, there is some interesting reflection code to get at the flag...)&lt;br /&gt;So anyway, the best way to solve this is to just track down where the exception is being thrown.  This is because the Paint/Draw Cell/etc methods automatically catch the exception (don't ask me why) so that you don't know where it happened.  Put try/catch blocks around every piece of code you wrote, and pop up a message if an error is found.  Good luck defeating the Big Red X!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112448656117569267?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112448656117569267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112448656117569267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112448656117569267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112448656117569267'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/big-red-x-nemesis-of-datagrid.html' title='The Big Red X - Nemesis of the Datagrid'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112438430384984209</id><published>2005-08-18T09:55:00.000-07:00</published><updated>2005-08-18T09:58:23.853-07:00</updated><title type='text'>Setting focus/visible to a control fails</title><content type='html'>There are two simple reasons why the Focused or Visible properties may not be what you expect.&lt;br /&gt;&lt;br /&gt;If you set the focus to a control when it isn't visible (such as during Form_Load), it will not work.  In the case of Form_Load, try to give it an appropriate TabIndex so that it is focused when the form comes up.&lt;br /&gt;&lt;br /&gt;If you set a control to visible when it is inside of a container control that is invisible, the control will remain invisible.  Set the parent to visible, and then the child.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112438430384984209?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112438430384984209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112438430384984209' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112438430384984209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112438430384984209'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/setting-focusvisible-to-control-fails.html' title='Setting focus/visible to a control fails'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112386662970481745</id><published>2005-08-12T10:01:00.000-07:00</published><updated>2005-08-12T10:10:29.710-07:00</updated><title type='text'>Insert an image to sql server database - CF</title><content type='html'>Inserting an image (or any byte[]) to a Sql Server Database in .NET is easy.  Create a parameter of type Image, set the value to the byte[], and add it to the command.&lt;br /&gt;So, when I tried to do this on the Compact Framework, who would have thought it would take three hours on google to duplicate this functionality!??&lt;br /&gt;&lt;br /&gt;Oh the insanity!&lt;br /&gt;&lt;br /&gt;After sleeping on it overnight, and resuming the search in the morning, I finally stumbled on what must apparently be obvious to everyone else.&lt;br /&gt;In the sql CommandText, instead of writing &lt;span style="font-size:85%;"&gt;"insert into image_table (image_field) values (@myParameterName)"&lt;/span&gt;, I changed it to &lt;span style="font-size:85%;"&gt;"insert into image_table (image_field) values (?)",&lt;/span&gt;&lt;br /&gt;and left everything else (including naming my parameter "@myParameterName") the same.&lt;br /&gt;And it worked.  Why the syntax suddenly changed, don't ask me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112386662970481745?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112386662970481745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112386662970481745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112386662970481745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112386662970481745'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/insert-image-to-sql-server-database-cf.html' title='Insert an image to sql server database - CF'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112318749918047439</id><published>2005-08-04T13:28:00.000-07:00</published><updated>2005-08-12T10:47:27.883-07:00</updated><title type='text'>Convert a String to Base64 in C#</title><content type='html'>I keep looking for a function like&lt;br /&gt;&lt;em&gt;public static string StringToBase64(string s)&lt;/em&gt; in &lt;em&gt;System.Text&lt;/em&gt;, etc.&lt;br /&gt;So far, the easiest way I've found to accomplish this is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;string sAscii = "my text";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;byte[] bytes = encoding.GetBytes(sAscii);&lt;br /&gt;string sBase64 = System.Convert.ToBase64String(bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;And how about just doing string -&gt; byte[] and back?  (no base 64?)&lt;br /&gt;&lt;span style="font-size:85%;"&gt;System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;byte[] bytes = encoding .GetBytes(sAscii);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;string sAscii = encoding.GetString(bytes);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112318749918047439?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112318749918047439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112318749918047439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112318749918047439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112318749918047439'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/08/convert-string-to-base64-in-c.html' title='Convert a String to Base64 in C#'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112259345347419610</id><published>2005-07-28T16:23:00.000-07:00</published><updated>2005-07-28T16:30:53.480-07:00</updated><title type='text'>Lego Dubloons</title><content type='html'>A three millimeter wide gold coin from a Lego pirate chest goes for 10 cents on Bricklink.com.  I just sold one today... a "40" dubloon piece, to be specific.  It makes me think that we should accept lego coins as legal tender.  They're much more lightweight and thus easier to carry, which is good considering the current rate of inflation.  For a handful of pirate coins, you could buy yourself a cable router.   Of course, counting them out would be a nightmare...&lt;br /&gt;I wonder if little kids know that they're holding several dollar's worth of coins when they fill up their pirate ships with plastic dubloons.  Maybe it would encourage them to hoarde the gold all the more.  Or maybe they already know... what an adult sees as valuable, a kid sees as ten times more valuable... because heck- I'd choose a pirate ship full of dubloons over a few more dollars any day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112259345347419610?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112259345347419610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112259345347419610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112259345347419610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112259345347419610'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/07/lego-dubloons.html' title='Lego Dubloons'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-112189572710391082</id><published>2005-07-20T14:30:00.000-07:00</published><updated>2005-07-20T14:42:47.603-07:00</updated><title type='text'>A Simple .ini File Reader/Writer</title><content type='html'>Here's a dirt simple class to save and load your variables from an .ini file.&lt;br /&gt;Just instantiate the class, &lt;em&gt;Write&lt;/em&gt; some variables, and call &lt;em&gt;Save&lt;/em&gt;. Calling &lt;em&gt;Read&lt;/em&gt; will retrieve your variables the next time that you need them. You'll need to save a file name (&lt;em&gt;SettingsPath&lt;/em&gt;) to specify where to save the .ini file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;/// &lt;summary&gt;&lt;br /&gt;/// Read/write to a very simple .ini file&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public class MyIni{&lt;br /&gt;public Hashtable ht;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;string SettingsPath = "C:\\MyIniFile.ini";&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;&lt;br /&gt;public MyIni()&lt;br /&gt;{&lt;br /&gt;ht = new Hashtable(10);&lt;br /&gt;this.Load();&lt;br /&gt;}&lt;br /&gt;public void Write(CfgFields field, string val)&lt;br /&gt;{&lt;br /&gt;Write(field.ToString(), val);&lt;br /&gt;}&lt;br /&gt;public void Write(string field, string val)&lt;br /&gt;{&lt;br /&gt;this.ht[field] = val;&lt;br /&gt;}&lt;br /&gt;public string Read(CfgFields field)&lt;br /&gt;{&lt;br /&gt;return Read(field.ToString());&lt;br /&gt;}&lt;br /&gt;public string Read(string field)&lt;br /&gt;{&lt;br /&gt;if(this.ht[field] == null)&lt;br /&gt;return "";&lt;br /&gt;else return this.ht[field].ToString();&lt;br /&gt;}&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Load data from .ini file to this class&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public void Load()&lt;br /&gt;{&lt;br /&gt;ht.Clear();&lt;br /&gt;System.IO.StreamReader r = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;r = System.IO.File.OpenText(SettingsPath);&lt;br /&gt;string line = r.ReadLine();&lt;br /&gt;while(line != null)&lt;br /&gt;{&lt;br /&gt;int i = line.IndexOf("=");&lt;br /&gt;ht.Add(line.Substring(0,i),line.Substring(i+1));&lt;br /&gt;line = r.ReadLine();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch{}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if(r != null)&lt;br /&gt;r.Close();&lt;br /&gt;}&lt;br /&gt;} // LOAD&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Save data from this class to .ini file&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public void Save()&lt;br /&gt;{&lt;br /&gt;StreamWriter w = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;w = System.IO.File.CreateText(SettingsPath);&lt;br /&gt;foreach(object o in this.ht.Keys)&lt;br /&gt;{&lt;br /&gt;string val = this.ht[o.ToString()].ToString();&lt;br /&gt;w.WriteLine(o.ToString() + "=" + val);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch{}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if(w != null)&lt;br /&gt;w.Close();&lt;br /&gt;}&lt;br /&gt;} // SAVE&lt;br /&gt;&lt;br /&gt;} // class&lt;br /&gt;&lt;br /&gt;/// Save your variable names here for easier access!&lt;br /&gt;public enum CfgFields&lt;br /&gt;{&lt;br /&gt;AVARIABLEA,&lt;br /&gt;BVARIABLEB,&lt;br /&gt;CVARIABLEC,&lt;br /&gt;DVARIABLED&lt;br /&gt;}&lt;/em&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-112189572710391082?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/112189572710391082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=112189572710391082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112189572710391082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/112189572710391082'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/07/simple-ini-file-readerwriter.html' title='A Simple .ini File Reader/Writer'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111948318189684462</id><published>2005-06-22T16:26:00.000-07:00</published><updated>2005-06-22T16:35:14.500-07:00</updated><title type='text'>The Blog format is NOT for URLs</title><content type='html'>Web designers need to STOP creating pages in the blog format, where the recentmost page is at the URL:&lt;br /&gt;forum-or-blog.com?page_no=1.&lt;br /&gt;Because, when new posts are added, they put them on "page_no=1" so that they are most recent. All previous pages get bumped up an index. My post that previously was on page 15, is now on page 16, and the next time I use my link to page 16 that either I or google have bookmarked, I end up looking at an Avacado Pie recipe.&lt;br /&gt;&lt;br /&gt;An obvious solution is to &lt;em&gt;display&lt;/em&gt; the posts in the desired (backwards) order, but to &lt;em&gt;index&lt;/em&gt; them in forwards order!  Assuming a fixed number of posts, (if it's not fixed, we need to save the index as a guid, or geez, anything other than a backwards index!), then if the earliest post is ALWAYS on page_no=1, and the 2nd post(s) are always on page_no=2, and so on, then adding a new page (page_no=100) WONT rename all my other pages! When creating navigation for a web user, just have them start on page 100, and click 'next' until they get to page '1'. But nooooo that would make too much sense.&lt;br /&gt;&lt;br /&gt;So until then, I'm just gonna have to keep on baking Avacodo pies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111948318189684462?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111948318189684462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111948318189684462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111948318189684462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111948318189684462'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/blog-format-is-not-for-urls.html' title='The Blog format is NOT for URLs'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111938904275311002</id><published>2005-06-21T14:13:00.000-07:00</published><updated>2005-06-21T14:24:02.756-07:00</updated><title type='text'>iPAQ Attachment cannot be Added</title><content type='html'>Now here's a great error message:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Message attachment cannot be added. Check to make sure the correct storage card is in the device. If your device stores attachments on a strorage card, you must insert a storage card to add any files to messages.&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;Even though you have a storage card, etc, it appears that some bug in the HP iPAQ can cause this to come up after certain files / settings with the storage card become invalid.  It happened to me after a program I was using crashed and restarted the system.&lt;br /&gt;A limited number of web users have posted the following fix:&lt;br /&gt;Use iPAQ backup and back up all data except email.  Perform hard reset.  Restore back up file.  Reconfigure your email settings.&lt;br /&gt;Well, wonder of wonders... it worked!  Now, if only I can find a component to send emails through .NET without using this buggy email program...  : )&lt;br /&gt;I have tested components from Mooseworks, CE Mail, Pocket Outlook ITH, IP Works, and DevMail, but all have failed in at least one aspect of sending and receiving emails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111938904275311002?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111938904275311002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111938904275311002' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111938904275311002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111938904275311002'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/ipaq-attachment-cannot-be-added.html' title='iPAQ Attachment cannot be Added'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13117585.post-111937472727346137</id><published>2005-06-21T10:23:00.000-07:00</published><updated>2005-06-21T10:25:27.276-07:00</updated><title type='text'>XML Files are too large</title><content type='html'>Now here's a simple tip to solve a lot of problems. &lt;br /&gt;Right click on an .xml file-&gt;Properties-&gt;Default Program, and choose 'Change'.  Set the default editor to Wordpad instead of Explorer.  That'll save your system from crashing every time IE tries to open a file that's over a few megabytes.  : )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111937472727346137?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111937472727346137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111937472727346137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111937472727346137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111937472727346137'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/xml-files-are-too-large.html' title='XML Files are too large'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111896382998402039</id><published>2005-06-16T16:09:00.000-07:00</published><updated>2005-06-16T16:19:50.450-07:00</updated><title type='text'>Download a file from the internet in C#</title><content type='html'>This code will download a file from the internet, while simultaneously updating a progress bar with the percent downloaded. Neat!&lt;br /&gt;&lt;br /&gt;Main Thread:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;using System.Threading;&lt;br /&gt;using System.Net;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;.......&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;ThreadStart ts = new ThreadStart(StartTimerThread);&lt;br /&gt;this.myTimerThread = new Thread(ts);&lt;br /&gt;myTimerThread.Start(); // This Thread will download the file&lt;br /&gt;while(myTimerThread.IsAlive)&lt;br /&gt;{ // Meanwhile, UI will keep track of the state of the download (progress bar)&lt;br /&gt;if(System.IO.File.Exists(saveToFile))&lt;br /&gt;{&lt;br /&gt;System.IO.FileInfo info = new System.IO.FileInfo(saveToFile);&lt;br /&gt;long size = info.Length;&lt;br /&gt;long progress = (100*size)/_fileSize;&lt;br /&gt;progBar.Value = (int)progress;&lt;br /&gt;DoPause(.5);  // call Application.DoEvents to refresh the progress bar in a pause function!&lt;br /&gt;}&lt;br /&gt;} // while thread is alive&lt;br /&gt;this.progBar.Value = 100;&lt;br /&gt;DoPause(0);&lt;/span&gt;&lt;/em&gt; &lt;span style="font-size:85%;"&gt;&lt;em&gt;// call Application.DoEvents to refresh the progress bar in a pause function!&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;The Thread that does all the work runs this function:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;private void StartTimerThread()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;mainClient = new WebClient();&lt;br /&gt;mainClient.DownloadFile(remoteFilePath, localFilePathBeingDownload);&lt;br /&gt;}&lt;br /&gt;catch{}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if(mainClient != null)&lt;br /&gt;mainClient.Dispose();&lt;br /&gt;}&lt;br /&gt;} // StartTimerThread&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;You'll need to initialize the progress bar's maximum as the size of the file: Here's how to get that:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;// get length&lt;br /&gt;System.Net.WebRequest request = null;&lt;br /&gt;WebResponse response = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;request = WebRequest.Create(remoteFilePath);&lt;br /&gt;response = request.GetResponse();&lt;br /&gt;WebHeaderCollection headers = response.Headers;&lt;br /&gt;string length = headers.Get("Content-Length");&lt;br /&gt;if(length==""length==null)&lt;br /&gt;length="0";&lt;br /&gt;updateFileSize = int.Parse(length);&lt;br /&gt;}&lt;br /&gt;catch{}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if(response!=null)&lt;br /&gt;response.Close();&lt;br /&gt;if(request!=null)&lt;br /&gt;request.Abort();&lt;br /&gt;}&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since &lt;em&gt;myTimerThread&lt;/em&gt; and &lt;em&gt;mainClient&lt;/em&gt; are defined at the class level, it will be easy to build a cancel button that simply kills the thread and disposes the client, thus aborting the main loop and ending the download.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;private void btnCancel_Click(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;bCancel = true;&lt;br /&gt;this.myTimerThread.Abort();&lt;br /&gt;if(mainClient!=null)&lt;br /&gt;mainClient.Dispose();&lt;br /&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111896382998402039?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111896382998402039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111896382998402039' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111896382998402039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111896382998402039'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/download-file-from-internet-in-c.html' title='Download a file from the internet in C#'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111894552711815161</id><published>2005-06-16T10:46:00.000-07:00</published><updated>2005-10-12T17:27:41.593-07:00</updated><title type='text'>Binding to a C# ComboBox</title><content type='html'>It is possible to bind a field to a ComboBox such that the user can edit the value as well as choose a new one from a list.&lt;br /&gt;First, populate your ComboBox by binding your DataTable of choices to it (or else add items manually):&lt;br /&gt;&lt;br /&gt;&lt;em&gt;myComboBox.DataSource = myDataChoicesTable;&lt;br /&gt;myComboBox.DisplayMember = "field_text";&lt;br /&gt;myComboBox.ValueMember = "field_text";&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Then, bind a DataTable containing one row of data to the ComboBox:&lt;br /&gt;&lt;em&gt;myComboBox.DataBindings.Add("Text", myDataTable, "my_text");&lt;/em&gt;&lt;br /&gt;&lt;p&gt;An important note: Your &lt;em&gt;myDataChoicesTable &lt;/em&gt;&lt;strong&gt;MUST &lt;/strong&gt;contain as one of the options the value in &lt;em&gt;myDataTable&lt;/em&gt; that you are initially using. Otherwise, the &lt;em&gt;my_&lt;/em&gt;text value will be displayed, but the .Text value will not be correct. You will need to modify the sql that generates the &lt;em&gt;myDataChoicesTable&lt;/em&gt; table and ensure the initial value is encluded. Don't know why this is necessary... seems like a bug to me- probably a 'feature' or else we're not supposed to be doing this.&lt;/p&gt;&lt;p&gt;Now, when the Combo's text is changed, the datasource needs to be updated manually, as it is not done by .NET. So, capture BOTH the &lt;em&gt;TextChanged&lt;/em&gt; &amp; &lt;em&gt;SelectedValueChanged&lt;/em&gt; events, and add something like:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;ComboBox cb = (ComboBox)sender;&lt;br /&gt;string s = cb.DataBindings[0].BindingMemberInfo.BindingField.ToString();&lt;br /&gt;DataTable dTable = (DataTable)cb.DataBindings[0].DataSource;&lt;br /&gt;dTable.Rows[0][s] = cb.Text;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Finally, to get the value from the ComboBox, just call &lt;em&gt;myComboBox.Text. &lt;/em&gt;Note that the SelectedValue and SelectedText properties will not "work" in this case, as you are binding to the Text property, not those other properties!&lt;/p&gt;&lt;p&gt;If you need to do some processing when the user changes the value of the ComboBox, you will need to put the action in BOTH the &lt;em&gt;TextChanged&lt;/em&gt; and the &lt;em&gt;SelectedValueChanged &lt;/em&gt;events of the ComboBox. This is because if the user types in a new value, the first event is fired. If they select a new value, the latter is fired. (Alternatively, put your logic in the LostFocus event, and just use the .Text property to get the value that was changed. (Though this will be called every time the user tabs through, even if they didn't change the value).&lt;/p&gt;&lt;p&gt;Lastly, in some rare cases, I needed to set BOTH the .Text property and .SelectedText property when setting the text automatically from code to get it to keep its value.&lt;/p&gt;&lt;p&gt;More problems: When the FIRST key is typed into the ComboBox, the TextChanged event fires, but the .Text property is NOT updated (retains old value). Solution would be to capture the Leave event and double check your data if you are doing processing on TextChanged.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111894552711815161?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111894552711815161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111894552711815161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111894552711815161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111894552711815161'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/binding-to-c-combobox.html' title='Binding to a C# ComboBox'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111877475493310644</id><published>2005-06-14T11:44:00.000-07:00</published><updated>2005-06-14T11:45:54.936-07:00</updated><title type='text'>Get Executable Path in C#</title><content type='html'>To get the Application Path of your Windows C# Executable in .net:&lt;br /&gt;System.Windows.Forms.Application.StartupPath&lt;br /&gt;or&lt;br /&gt;System.Windows.Forms.Application.ExecutablePath for the fileName.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111877475493310644?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111877475493310644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111877475493310644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111877475493310644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111877475493310644'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/get-executable-path-in-c.html' title='Get Executable Path in C#'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111825418578975769</id><published>2005-06-08T11:08:00.000-07:00</published><updated>2005-06-08T11:09:45.793-07:00</updated><title type='text'>Application Icon for .NET Exectuable</title><content type='html'>To set an icon for an executable .NET project, set the value at:&lt;br /&gt;MS Visual Studio-&gt;Project-&gt;Proj Properties-&gt;Application Icon to the resource file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111825418578975769?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111825418578975769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111825418578975769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111825418578975769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111825418578975769'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/application-icon-for-net-exectuable.html' title='Application Icon for .NET Exectuable'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111820732633865866</id><published>2005-06-07T22:06:00.000-07:00</published><updated>2005-06-07T22:08:46.340-07:00</updated><title type='text'>Insert with MS Access; return AutoNumber</title><content type='html'>C# Function to execute a SQL INSERT statement and return the recentmost Autonumber generated (for the insert).  Since this is within a 'connection' it should be fairly autonomous.  TODO: Find out whether it needs to be within a transaction as well.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Execute Insert Command against the Database.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="sqlText"&gt;INSERT command to execute&lt;/param&gt;&lt;br /&gt;/// &lt;returns&gt;last generated AutoNumber value (for the insert)&lt;/returns&gt;&lt;br /&gt;public static int ExecuteInsert(string sqlText)&lt;br /&gt;{&lt;br /&gt;// establish a connection to an access database hosted on brinkster&lt;br /&gt;System.Data.OleDb.OleDbConnection connection = Utilities.Connection;&lt;br /&gt;int id = 0;&lt;br /&gt;// Create the command object to perform the insert/update/delete command&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand(sqlText, connection);&lt;br /&gt;command.ExecuteNonQuery();&lt;br /&gt;sqlText = "SELECT @@IDENTITY AS IDVal"; // get last autonumber&lt;br /&gt;command = new System.Data.OleDb.OleDbCommand(sqlText, connection);&lt;br /&gt;object o = command.ExecuteScalar();&lt;br /&gt;id = Utilities.FromDB(o);&lt;br /&gt;command = null;&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;throw new System.Exception(sqlText + ", " + e.ToString());&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;// now close and destroy the connection object&lt;br /&gt;connection.Close();&lt;br /&gt;connection = null;&lt;br /&gt;}&lt;br /&gt;return id;&lt;br /&gt;} // insert&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111820732633865866?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111820732633865866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111820732633865866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111820732633865866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111820732633865866'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/insert-with-ms-access-return.html' title='Insert with MS Access; return AutoNumber'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111809319716539631</id><published>2005-06-06T14:23:00.000-07:00</published><updated>2005-06-06T14:26:44.543-07:00</updated><title type='text'>Multithreaded Crystal Report Error in 10.x</title><content type='html'>Using CR Version 9.x, calling the following (to load a Report) in multiple threads works fine:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;reportDocument1.Load(sRptPath);&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;But in Version 10.x, this results in an error on the second call, and any successive ones. A null reference is thrown at&lt;br /&gt;&lt;em&gt;CrystalDecisions.CrystalReports.Engine.ReportDocument.GetConcurrentUsage()&lt;/em&gt;&lt;br /&gt;which is called within &lt;em&gt;Load&lt;/em&gt;. I need to figure out why this is happening and what the solution is. It seems like a bug. &lt;em&gt;Load&lt;/em&gt; works fine when called successively within the same thread, just not in successive multiple threads.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111809319716539631?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111809319716539631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111809319716539631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111809319716539631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111809319716539631'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/multithreaded-crystal-report-error-in.html' title='Multithreaded Crystal Report Error in 10.x'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111807603741671633</id><published>2005-06-06T09:38:00.000-07:00</published><updated>2005-06-06T09:40:37.420-07:00</updated><title type='text'>Sending a fax using Windows Faxing in C#</title><content type='html'>Adding a reference to FAXCOMLib.dll (COM/Fax Services) in Windows XP provides access to the Windows Fax Service, which you can use to send a fax as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();&lt;br /&gt;if (FaxNumber != "")&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;faxServer.Connect(MachineName);&lt;br /&gt;faxServer.Retries = Retries;&lt;br /&gt;faxServer.RetryDelay = RetryDelay;&lt;br /&gt;FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);&lt;br /&gt;faxDoc.RecipientName = RecipientName;&lt;br /&gt;faxDoc.FaxNumber = FaxNumber;&lt;br /&gt;faxDoc.DisplayName = DocumentName;&lt;br /&gt;int Response = faxDoc.Send();&lt;br /&gt;success = true;&lt;br /&gt;}&lt;br /&gt;catch{}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;faxServer.Disconnect();&lt;br /&gt;} // disconnect&lt;br /&gt;} // send fax&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111807603741671633?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111807603741671633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111807603741671633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111807603741671633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111807603741671633'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/sending-fax-using-windows-faxing-in-c.html' title='Sending a fax using Windows Faxing in C#'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111782857049759432</id><published>2005-06-03T12:54:00.000-07:00</published><updated>2005-06-03T12:56:10.500-07:00</updated><title type='text'>C# - Close form during Load Event</title><content type='html'>Closing a C# Windows Form during the Load Event is not allowed, and neither is closing it during &lt;em&gt;CreateHandle&lt;/em&gt; or &lt;em&gt;OnHandleCreated&lt;/em&gt;. &lt;br /&gt;To close the form, call &lt;em&gt;Close&lt;/em&gt; during the &lt;em&gt;VisibleChanged&lt;/em&gt; Event, when &lt;em&gt;Visible&lt;/em&gt;=true (called when showing the form).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111782857049759432?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111782857049759432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111782857049759432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111782857049759432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111782857049759432'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/06/c-close-form-during-load-event.html' title='C# - Close form during Load Event'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111756699927121678</id><published>2005-05-31T12:07:00.000-07:00</published><updated>2005-05-31T12:16:39.276-07:00</updated><title type='text'>Yellowbeam</title><content type='html'>Book IV of History of Galaxy isn't going so well.  I've rethunk the plot direction, but it still seems to lack that 'great idea' that motivates one's self to write.  Here's the new intro I wrote to hopefully give me some inspiration for the new plot direction: A look into the history of the Xenonites, rather than focusing primarily on Atakala.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;In the days of old, there were many worlds scattered among the galaxy as divers as the very stars themselves.      And on these worlds were created both plants and animals, with rivers and falls and meadows and hills for their use.  But there were certain worlds to whom were granted a most remakable wonder – beings that could not only see the world in which they had been placed, but could aso engage it, molding it to their whims and desires.  Above all, they had been given both desire and power to bring order to their worlds.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111756699927121678?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111756699927121678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111756699927121678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111756699927121678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111756699927121678'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/05/yellowbeam.html' title='Yellowbeam'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111687447512274183</id><published>2005-05-23T11:52:00.000-07:00</published><updated>2005-05-23T11:54:35.123-07:00</updated><title type='text'>Installing Fonts in C#</title><content type='html'>The following C# code will install a font on a 32 bit machine.&lt;br /&gt;&lt;br /&gt;int Ret;&lt;br /&gt;int Res;&lt;br /&gt;string FontPath;&lt;br /&gt;const int WM_FONTCHANGE = 0x001D;&lt;br /&gt;const int HWND_BROADCAST = 0xffff;&lt;br /&gt;FontPath = WinFontDir + "\\" + FontFileName;&lt;br /&gt;Ret = FontInstall.AddFontResource(FontPath);&lt;br /&gt;Res = FontInstall.SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);&lt;br /&gt;Ret = FontInstall.WriteProfileString("fonts", FontName + " (TrueType)", FontFileName);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With of course, the API functions:&lt;br /&gt;&lt;br /&gt;[DllImport("kernel32.dll", SetLastError=true)] static extern int WriteProfileString( string lpszSection, string lpszKeyName, string lpszString) ;&lt;br /&gt;&lt;br /&gt;[DllImport("user32.dll")]&lt;br /&gt;public static extern int SendMessage(int hWnd, // handle to destination window&lt;br /&gt;uint Msg, // message&lt;br /&gt;int wParam, // first message parameter&lt;br /&gt;int lParam // second message parameter&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;[DllImport("gdi32")]&lt;br /&gt;public static extern int AddFontResource(string lpFileName);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111687447512274183?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111687447512274183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111687447512274183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111687447512274183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111687447512274183'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/05/installing-fonts-in-c.html' title='Installing Fonts in C#'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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-13117585.post-111687405583360741</id><published>2005-05-23T11:40:00.000-07:00</published><updated>2005-05-23T11:47:35.836-07:00</updated><title type='text'>Crystal Reports has Blank Pages</title><content type='html'>For a while, I kept getting blank pages in Crystal Reports version 8.x.  To remove them, I had to take the following actions:&lt;br /&gt;Shrink all empty sections to 0 height.  Set all ‘suppress blank sections’ to true wherever blank sections may occur.  Don’t ‘keep group together’ for any outer level groups.  Ensure you aren't setting a new page on first/last page, or for more than one group section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13117585-111687405583360741?l=sector23.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sector23.blogspot.com/feeds/111687405583360741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13117585&amp;postID=111687405583360741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111687405583360741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13117585/posts/default/111687405583360741'/><link rel='alternate' type='text/html' href='http://sector23.blogspot.com/2005/05/crystal-reports-has-blank-pages.html' title='Crystal Reports has Blank Pages'/><author><name>Amos Z</name><uri>http://www.blogger.com/profile/12943900943075069893</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>
