<?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-35134354</id><updated>2011-11-27T19:08:42.657-06:00</updated><category term='VBScript'/><category term='ArcGIS Server'/><category term='ArcIMS'/><category term='Microsoft'/><category term='WIF'/><category term='CheckBoxList'/><category term='XP'/><category term='SalesForce'/><category term='BorderStyle'/><category term='IE9'/><category term='ArcView'/><category term='RowUpdating'/><category term='DrillthroughEventArgs'/><category term='System.Windows.Forms.Label'/><category term='ASP.NET'/><category term='ESRI'/><category term='Single-Sign-On'/><category term='.NET Framework 2'/><category term='Themes'/><category term='Network Share'/><category term='QueryString'/><category term='VS.NET Add-In'/><category term='ArcGIS 9.2'/><category term='Delphi'/><category term='Software'/><category term='Functional Specs'/><category term='Master Pages'/><category term='Zoom To'/><category term='WebADF'/><category term='BackColor'/><category term='ASP classic'/><category term='MSSQL'/><category term='jQuery'/><category term='CSS'/><category term='ASP.NET Reports'/><category term='GridView'/><category term='ReportViewer'/><category term='SSO'/><category term='Highlight Features'/><category term='Windows Identity Foundtion'/><category term='Templates'/><category term='C#'/><category term='VBA'/><category term='Firefox'/><category term='ForeColor'/><category term='Drill Down Reports'/><category term='SQLExpress'/><category term='UNC'/><category term='Skins'/><category term='JavaScript'/><title type='text'>Adventures in C#</title><subtitle type='html'>While I have been working in desktop applications with C# for several years, there is always learning going on as new things arise, and new programs are created.  I started this to document my new experiences in the world of C# programming.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35134354.post-522816761326886151</id><published>2011-05-19T18:10:00.001-06:00</published><updated>2011-05-19T18:10:43.611-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLExpress'/><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>Recovering a SQLEXPRESS Installation</title><content type='html'>&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;" id="internal-source-marker_0.9640969566086892"&gt;I  inherited a desktop machine at work. It wasn’t scrubbed and re-fitted  with a fresh install when I arrived. Recently I have been examining  processes for Single-Sign-On, and really needed to play around with the  local installation of SqlExpress, so as not to screw up the dev database  for everyone else. One problem though, the previous tenant of the  machine followed best security practices and remove the  BUILTIN\Administrators user from the database and I nobody knew the  System Administrator (sa) password - add to that, the sa account was  disabled (again, good security practice!).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;With  that in mind, I set out on the path to discover how I can recover that  installation, and not have to go through the process of uninstalling and  re-installing SqlExpress. I finally came across &lt;/span&gt;&lt;a href="http://deepakrangarajan.blogspot.com/2008/01/forgot-sa-password-in-sql-server-2005.html"&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000099;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:underline;vertical-align:baseline;"&gt;this old post &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;at Phoenix blog. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;A  few things to keep in mind; His instructions are for full-blown SQL  Server, so instead of using “NET STOP MSSQLSERVER” you’ll have to use  “NET STOP MSSQL$SQLEXPRESS”. This is for all the stop and starts.  Also,  one has to have local administrator privileges on the machine, if you  don’t have that, as far as I know, you’re pretty much up a creek without  a paddle. The process is quick and simple really, I’ll post the steps  here (without the nice screen-scrapes that Deepak has in his blog, you  can go there and look at them if you need to).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;1) Open command line window&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;2) type NET STOP MSSQL$SQLEXPRESS and wait for the service to stop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;3)  type NET START MSSQL$SQLEXPRESS /m - this puts sql server in  single-user mode (I am not sure what that is really, but hey,it works!)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;4)  Open your SQL Server Management Studio, and click “New Query” you’ll be  presented with the connection dialog window, select the instance of  SqlExpress and open the connection.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;5)  In the new query window type “sp_addsrvrolemember ‘YOUR_USER_NAME’,  ‘SYSADMIN’” (sans quotes, of course). This will add your login to the  sysadmin role.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;6) Close  Management Studio.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;7) Back in the command prompt window type “NET STOP MSSQL$SQLEXPRESS” to stop the service&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;"&gt;8)  Next time “NET START MSSQL$SQLEXPRESS” in the command prompt to start  the service again, but in normal mode (not single user mode this time,  notice the lack of ‘/m’ switch in the command.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-522816761326886151?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/522816761326886151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=522816761326886151&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/522816761326886151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/522816761326886151'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2011/05/recovering-sqlexpress-installation.html' title='Recovering a SQLEXPRESS Installation'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-5282306104153881781</id><published>2011-05-06T23:05:00.002-06:00</published><updated>2011-05-06T23:12:16.490-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SalesForce'/><category scheme='http://www.blogger.com/atom/ns#' term='WIF'/><category scheme='http://www.blogger.com/atom/ns#' term='Single-Sign-On'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Identity Foundtion'/><category scheme='http://www.blogger.com/atom/ns#' term='SSO'/><title type='text'>SalesForce excitement with .NET</title><content type='html'>Been getting to work some with the SalesForce Apex API, grabbing and pushing data from and to the SalesForce data store. After a bit of a learning curve, it's turning out to not be fairly easy going. I do need to look a bit deeper into bulk uploads, as some of the stuff we'll be pushing is 30K plus recordsets, granted, that isn't a lot, but could be enough that using their bulk API might make sense.&lt;br /&gt;&lt;br /&gt;Next project on deck is creating a Single-Sign-On into SalesForce. This is going to be a bit more daunting I think. All of the SalesForce samples and help deal with OpenSSO running on it's own server. We're going to go with the &lt;a href="http://msdn.microsoft.com/en-us/security/aa570351.aspx"&gt;Windows Identity Foundation&lt;/a&gt; tools, using the SSO into SalesForce as a launching pad for a new login process for all of the apps across the board. Creating an SSO for everything will mean that all logins will hit the same page, utilize the same processes, no matter if they come to the app via a web browser, or an iPhone, or a Xoom tablet or whatever. Should be great fun and a terrific learning experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-5282306104153881781?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/5282306104153881781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=5282306104153881781&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5282306104153881781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5282306104153881781'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2011/05/salesforce-excitement-with-net.html' title='SalesForce excitement with .NET'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-6584779540723752102</id><published>2011-05-06T22:58:00.004-06:00</published><updated>2011-05-06T23:05:13.694-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>FireFox 4 jQuery document height and width</title><content type='html'>I ran into a little problem the other day. I had some jQuery goodness running along just fine and dandy. Everything was Jake while using Chrome and Internet Explorer 9 and FireFox 3, but when I looked at the site using FireFox 4, it didn't work right.&lt;br /&gt;&lt;br /&gt;After some aggravating trial and error, I discovered the culprit. See, in the jQuery documentation, they say you can use two methods to get the height and width of a document:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;$(document).height();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$(document).css('height');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The former gives you just the pixel numbers, while the latter is supposed to give you the entire CSS height (i.e. "450" for the first, and "450px" for the second). The problem is, that FireFox 4 doesn't recognize $(document).css('height') - or width for that matter. So you have to get it with just the .height() command, and append 'px' to the end of it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-6584779540723752102?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/6584779540723752102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=6584779540723752102&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6584779540723752102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6584779540723752102'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2011/05/firefox-4-again-messes-with-jquery.html' title='FireFox 4 jQuery document height and width'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-9193820864491503137</id><published>2011-03-17T17:34:00.003-06:00</published><updated>2011-03-17T17:57:30.355-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='IE9'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>CSS funkiness with Firefox</title><content type='html'>Normally, I check page layout and styles in IE and in Firefox. These two, I've found, have pretty much been good. If it works in those, it works usually in Chrome and Opera as well. I never check Safari, frankly that browser just slows down my system. My advice to folks using Safari is pretty much "use something else".&lt;br /&gt;&lt;br /&gt;Anyway, I was fitting a checkbox today, and cursed a little under my breath when it didn't show up properly positioned in IE9. It's possible that if I'd been using IE8 or even IE7, I might not have found this, since those pretty much handle CSS in the same manner as Firefox. To be honest, I was ready for this to be IE9's fault, so I fired up Chrome and Opera to verify my assumptions. You could have knocked me over with a feather when the page rendered in Chrome and Opera just the same as it did in IE9. It was Firefox that was the problem.&lt;br /&gt;&lt;br /&gt;Now, I'm used to making exceptions for IE, so I had to do a bit of research on how to do it with Firefox, and this is what I found:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.complete-checkbox&lt;br /&gt;{&lt;br /&gt;        position:relative;&lt;br /&gt;        top:23px;&lt;br /&gt;        display:block;&lt;br /&gt;        float:right;&lt;br /&gt;        color:white;&lt;br /&gt;        font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@-moz-document url-prefix() {&lt;br /&gt;        .complete-checkbox-ff&lt;br /&gt;        {&lt;br /&gt;                position:relative;&lt;br /&gt;                top:0px;&lt;br /&gt;                display:block;&lt;br /&gt;                float:right;&lt;br /&gt;                color:white;&lt;br /&gt;                font-weight:bold;&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Essentially, I added a second class specifically for Firefox and used those properties only if the browser is Mozilla.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-9193820864491503137?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/9193820864491503137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=9193820864491503137&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/9193820864491503137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/9193820864491503137'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2011/03/css-funkiness-with-firefox.html' title='CSS funkiness with Firefox'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-4696726309575484037</id><published>2008-06-06T12:57:00.001-06:00</published><updated>2008-06-06T12:57:29.038-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Master Pages'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ESRI'/><title type='text'>ESRI &amp; ASP.NET Master Pages</title><content type='html'>&lt;p&gt;One of the great things about VS 2005 &amp;amp; ASP.NET 2.0+ is the ability to quickly and easily create and user Master Pages in your ASP.NET web application.&lt;/p&gt;  &lt;p&gt;One of the horribly difficult things about Master Pages is when using mash-ups, figuring out how they work exactly. Ok, if you don't know about Master Pages, then you should probably investigate them some.&lt;/p&gt;  &lt;p&gt;A Master Page is not really a page, but rather a template that holds containers into which pages render (but can also regular HTML there as well). So a Master Page can have your title, image banner, navigation links, login stuff, breadcrumb trail...all that stuff, and also contains one or more &amp;quot;ContentPlaceHolder&amp;quot; controls.&lt;/p&gt;  &lt;p&gt;The problem when putting an ArcGIS Server map in a page that has a master page is that when the page is rendered, the name of the map changes. That is, if you leave you map the default &amp;quot;Map1&amp;quot; name, when rendered, it has the name &amp;quot;ct00_ContentPlaceHolder1_Map1&amp;quot;. Assuming, of course, you lave the ContentPlaceHolder name the default AND you put the map in the first instance of the ContentPlaceHolder controls.&lt;/p&gt;  &lt;p&gt;This creates issue when attempting to access the map via JavaScript. In the WebMapApp.js file that is defaultly created when a Web Mapping Application is created in VS2005, it is assuming that you leave everything as the default names when you put stuff in the map. With that in mind, it uses names like &amp;quot;Map1&amp;quot;, &amp;quot;TaskResults1&amp;quot; etc. &lt;/p&gt;  &lt;p&gt;To fix this, I created a global var in the javascript file:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; webMapControlPrefix = &lt;span class="str"&gt;&amp;quot;ctl00_ContentPlaceHolder1_&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So, for instance, the setpageElementSizes() function goes to define the scale bar , it used to do:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;webMapAppScaleBar = document.getElementById(&lt;span class="str"&gt;&amp;quot;ScaleBar1&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;But now, I have it looking like this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;webMapAppScaleBar = document.getElementById(webMapControlPrefix+&lt;span class="str"&gt;&amp;quot;ScaleBar1&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You probably get the idea. If not, drop a comment and I'll see what I can find out about whatever confusion there is.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:223ca083-c2cc-4627-8f56-58be1e753448" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ESRI" rel="tag"&gt;ESRI&lt;/a&gt;,&lt;a href="http://technorati.com/tags/JavaScript" rel="tag"&gt;JavaScript&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Master%20Pages" rel="tag"&gt;Master Pages&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f65192c7-1b29-4030-9b1f-26ea9bbc06f4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/ESRI" rel="tag"&gt;ESRI&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/JavaScript" rel="tag"&gt;JavaScript&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Master%20Pages" rel="tag"&gt;Master Pages&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-4696726309575484037?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/4696726309575484037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=4696726309575484037&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4696726309575484037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4696726309575484037'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/06/esri-aspnet-master-pages.html' title='ESRI &amp;amp; ASP.NET Master Pages'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-551233549813239886</id><published>2008-04-21T13:29:00.001-06:00</published><updated>2008-04-21T13:29:31.091-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RowUpdating'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><title type='text'>GridView RowUpdating: Stupid, stupid stupid error</title><content type='html'>&lt;p&gt;Making an error in your code is one thing. But making an error that is so brilliantly, blatantly and egregiously stupid...well, that is something wholly and completely different.&lt;/p&gt;  &lt;p&gt;Case in point. I have a GridView control on a page. I need to be able to edit that GridView control. However, to populate the GridView, I need a dataset which contains a &amp;quot; WHERE [COLUMN] IN (values)&amp;quot; where clause. The problem is, that the SqlDataSource really doesn't seem to support this very easily. I'm almost-but-not-quite certain it probably-might-possibly does, but I couldn't figure it out.&lt;/p&gt;  &lt;p&gt;Because of that, I needed to bind the GridView to a DataSource programmatically. And that I did, right off the bat, right when the page loads, because, you know, I want the damn data right the hell away.&lt;/p&gt;  &lt;p&gt;So what I neglected to do was put the data binding declarations in the good ol' trusty &amp;quot;if (!Page.IsPostBack)&amp;quot; statement. Which means that each and ever time the page loaded (i.e, when I clicked the &amp;quot;Edit&amp;quot; and &amp;quot;Update&amp;quot; links) the GridView was rebound to the original data. No fracking wonder my stuff wasn't working.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-551233549813239886?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/551233549813239886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=551233549813239886&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/551233549813239886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/551233549813239886'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/04/gridview-rowupdating-stupid-stupid.html' title='GridView RowUpdating: Stupid, stupid stupid error'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-6826162837199065438</id><published>2008-03-31T10:31:00.001-06:00</published><updated>2008-03-31T10:35:42.056-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 2'/><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS Server'/><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS 9.2'/><category scheme='http://www.blogger.com/atom/ns#' term='Zoom To'/><category scheme='http://www.blogger.com/atom/ns#' term='Highlight Features'/><category scheme='http://www.blogger.com/atom/ns#' term='ESRI'/><title type='text'>Highlighting features with ArcGis Server 9.2</title><content type='html'>&lt;p&gt;I have the need to highlight items when the user selects to zoom to a particular item from a custom search. If I was using the ResultsTask control, then the user could simply check the checkbox next to the feature, and it would highlight. However, since the client doesn't like the treeview style of the ResultsTask, I have put the search results into an HTML table. Now, when the user selects to zoom to a feature, it will automatically highlight the feature.&lt;/p&gt;  &lt;p&gt;I found this code in the ESRI forums, and it works well.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// This gives us a nice light blue color. You can change the color to whatever you want.&lt;/span&gt;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.RgbColor irgbc = &lt;span class="kwrd"&gt;new&lt;/span&gt; ESRI.ArcGIS.ADF.ArcGISServer.RgbColor();&lt;br /&gt;irgbc.Red = 50;&lt;br /&gt;irgbc.Green = 255;&lt;br /&gt;irgbc.Blue = 255;&lt;br /&gt;irgbc.AlphaValue = 255;&lt;br /&gt;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.FIDSet fids = &lt;span class="kwrd"&gt;new&lt;/span&gt; ESRI.ArcGIS.ADF.ArcGISServer.FIDSet();&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt;[] ids = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;[1];&lt;br /&gt;ids[0] = Convert.ToInt32(key); &lt;span class="rem"&gt;//&amp;lt;-- OBJECTID of the feature to highlight&lt;/span&gt;&lt;br /&gt;fids.FIDArray = ids;&lt;br /&gt;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdesc = ((MapFunctionality)mf).MapDescription;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription[] layerdescs = mapdesc.LayerDescriptions;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription layerdesc = layerdescs[layerid];&lt;br /&gt;layerdesc.Visible = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;br /&gt;layerdesc.SelectionColor = irgbc;&lt;br /&gt;layerdesc.SelectionFeatures = fids.FIDArray;&lt;/pre&gt;&lt;br /&gt;The problem with the above code is that it highlights the entire area. Not bad for point features, but for polygons, it covers everything underneath it completely. I tried adjusting the RgbColor.AlphaValue, but that didn't change anything at all. I'm thinking that is a red herring, and doesn't really do anything at all. So what I decided to do was instead of filling the entire polygon, I just use ShowSelectBuffer as seen below: &lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;ESRI.ArcGIS.ADF.ArcGISServer.RgbColor irgbc = &lt;span class="kwrd"&gt;new&lt;/span&gt; ESRI.ArcGIS.ADF.ArcGISServer.RgbColor();&lt;br /&gt;irgbc.Red = 50;&lt;br /&gt;irgbc.Green = 255;&lt;br /&gt;irgbc.Blue = 255;&lt;br /&gt;irgbc.AlphaValue = 255;&lt;br /&gt;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.FIDSet fids = &lt;span class="kwrd"&gt;new&lt;/span&gt; ESRI.ArcGIS.ADF.ArcGISServer.FIDSet();&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt;[] ids = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;[1];&lt;br /&gt;ids[0] = Convert.ToInt32(key);&lt;br /&gt;fids.FIDArray = ids;&lt;br /&gt;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdesc = ((MapFunctionality)mf).MapDescription;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription[] layerdescs = mapdesc.LayerDescriptions;&lt;br /&gt;ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription layerdesc = layerdescs[layerid];&lt;br /&gt;layerdesc.Visible = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;br /&gt;layerdesc.ShowSelectionBuffer = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;br /&gt;layerdesc.SelectionFeatures = fids.FIDArray;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;By using LayerDescription.ShowSelectBuffer, the feature is outlined with the highligh color, instead of filled in. This gives us the ability to see what is within the feature, while still knowing where the feature was located.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;References:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2276&amp;amp;t=211190&amp;amp;mc=12#msgid719661" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2276&amp;amp;t=211190&amp;amp;mc=12#msgid719661&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2276&amp;amp;t=223224&amp;amp;mc=1" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2276&amp;amp;t=223224&amp;amp;mc=1&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-6826162837199065438?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/6826162837199065438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=6826162837199065438&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6826162837199065438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6826162837199065438'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/03/highlighting-features-with-arcgis.html' title='Highlighting features with ArcGis Server 9.2'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-5550175163832004844</id><published>2008-03-28T10:15:00.002-06:00</published><updated>2008-03-28T10:29:21.368-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS Server'/><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS 9.2'/><category scheme='http://www.blogger.com/atom/ns#' term='Zoom To'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ESRI'/><title type='text'>ESRI breaks my custom zoom to method</title><content type='html'>&lt;p&gt;I have an ArcGIS Server application. The client didn't like the standard format ESRI uses for displaying search results. So I made my own version. Basically, I return an HTML table through Callback scripting and populate a DIV with it. That table contains a column which is a hyperlink which calls functionality to zoom to that particular feature. Here's my code for that:&lt;/p&gt;  &lt;div    style="background: white none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:courier new;font-size:10pt;color:black;"&gt;   &lt;pre style="margin: 0px;"&gt; System.Data.&lt;span style="color: rgb(43, 145, 175);"&gt;DataTable&lt;/span&gt; dataTable = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IMapFunctionality&lt;/span&gt; mf = (ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IMapFunctionality&lt;/span&gt; )Map1.GetFunctionality(0);&lt;br /&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (mf != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IGISResource&lt;/span&gt; gisresource = mf.Resource;&lt;br /&gt;    &lt;span style="color:blue;"&gt;bool&lt;/span&gt; supported = gisresource.SupportsFunctionality(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;));&lt;br /&gt;    &lt;span style="color:blue;"&gt;int&lt;/span&gt; shapeInd = -1;&lt;br /&gt;    &lt;span style="color:blue;"&gt;if&lt;/span&gt; (supported)&lt;br /&gt;    {&lt;br /&gt;        ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt; qfunc;&lt;br /&gt;        qfunc = (ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;)gisresource.CreateFunctionality(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;), &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;br /&gt;        &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] lids;&lt;br /&gt;        &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] lnames;&lt;br /&gt;        qfunc.GetQueryableLayers(&lt;span style="color:blue;"&gt;null&lt;/span&gt;, &lt;span style="color:blue;"&gt;out&lt;/span&gt; lids, &lt;span style="color:blue;"&gt;out&lt;/span&gt; lnames);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;All this works splendidly...or at least it did. That was until I went an used ESRI's MapIdentify tool. This tool by default puts things in the task results panel. When I used the zoom to functionality in the task results panel, I noticed that my custom zoom to method suddenly quick functioning. This was distressing to say the least. It seems that every time I actually start to feel like I somewhat understand ArcGIS, I get blind-sided by something stupid like this.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;After some careful debugging, I discovered what was happening was that ESRI stacks new MapResourceItems on top of the actual map when you interact with the task results. So originally my code was working fine when I was getting MapResourceItems[0] since that was the only MapResourceItem. But after running the task results, both the layer names and layer ids returned from the GetQueryalbleLayers() method were coming back as GUIDs.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;My solution was to loop through all MapResourceItems until I found a MapResourceItem with a name that matches the map name.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div    style="background: white none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:courier new;font-size:10pt;color:black;"&gt; &lt;pre&gt;  System.Data.&lt;span style="color: rgb(43, 145, 175);"&gt;DataTable&lt;/span&gt; dataTable = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt; ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IMapFunctionality&lt;/span&gt; mf = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; &lt;span style="color:blue;"&gt;this&lt;/span&gt;.MapResourceManager1.ResourceItems.Count; i++)&lt;br /&gt; {&lt;br /&gt;    &lt;span style="color:blue;"&gt;if&lt;/span&gt; (&lt;span style="color:blue;"&gt;string&lt;/span&gt;.Compare(&lt;span style="color:blue;"&gt;this&lt;/span&gt;.MapResourceManager1.ResourceItems[i].Name, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.m_mapName, &lt;span style="color:blue;"&gt;true&lt;/span&gt;) == 0)&lt;br /&gt;    {&lt;br /&gt;  mf = (ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IMapFunctionality&lt;/span&gt;)Map1.GetFunctionality(i);&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (mf != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;br /&gt; {&lt;br /&gt;   ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IGISResource&lt;/span&gt; gisresource = mf.Resource;&lt;br /&gt;   &lt;span style="color:blue;"&gt;bool&lt;/span&gt; supported = gisresource.SupportsFunctionality(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;));&lt;br /&gt;   &lt;span style="color:blue;"&gt;int&lt;/span&gt; shapeInd = -1;&lt;br /&gt;   &lt;span style="color:blue;"&gt;if&lt;/span&gt; (supported)&lt;br /&gt;   {&lt;br /&gt;      ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt; qfunc;&lt;br /&gt;      qfunc = (ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;)gisresource.CreateFunctionality(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(ESRI.ArcGIS.ADF.Web.DataSources.&lt;span style="color: rgb(43, 145, 175);"&gt;IQueryFunctionality&lt;/span&gt;), &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;br /&gt;      &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] lids;&lt;br /&gt;      &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] lnames;&lt;br /&gt;      qfunc.GetQueryableLayers(&lt;span style="color:blue;"&gt;null&lt;/span&gt;, &lt;span style="color:blue;"&gt;out&lt;/span&gt; lids, &lt;span style="color:blue;"&gt;out&lt;/span&gt; lnames);&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-5550175163832004844?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/5550175163832004844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=5550175163832004844&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5550175163832004844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5550175163832004844'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/03/esri-breaks-my-custom-zoom-to-method.html' title='ESRI breaks my custom zoom to method'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-5070334791713340781</id><published>2008-03-19T14:25:00.001-06:00</published><updated>2008-03-19T14:25:09.380-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET Add-In'/><title type='text'>BlogMyCode VS2005 plugin</title><content type='html'>&lt;p&gt;I have been using Windows Live Writer for quite a while now. I like it. It contains all the info for my different blogs. It is a desktop app. Makes it easy to start a post, save it as a draft, and continue it on later and when you actually get around to posting, it uses current date/time stamp. I know blogger for instance, will post a draft with the date/time stamp of when you started it, now when you finish it.&lt;/p&gt;  &lt;p&gt;What I have not been doing is using WLW to its full extent, or even, it seems, a portion of that extent. As I was finally getting it setup on my work computer (I had to bypass the lockout for Windows Update to do it - don't tell the IS folks, ok?). As I was searching for plugins for WLW, I can across a plugin for Visual Studio 2005 which, I have to tell you, Is freaking awesome! &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;BlogMyCode is Microsoft Visual Studio 2005 plugin, that helps you to blog formatted source code, by using &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt;.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;BlogMyCode adds a &amp;quot;Blog This&amp;quot; element to your context menu in VS2005. Highlight some code, right-click, select &amp;quot;Blog This&amp;quot; and in just a few steps, you get this:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; ParcelIdentify(&lt;span style="color: #2b91af"&gt;Map&lt;/span&gt; map, &lt;span style="color: blue"&gt;string&lt;/span&gt; filePath)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; m_map = map;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; m_filePath = filePath;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; SetupIdentify();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The drawback I have found so far (and it is probably a setting somewhere in WLW) is that when I do the &amp;quot;Blog This&amp;quot;, it opens a new instance of WLW and starts a new post.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You can get the &lt;a title="BlogMyCode VS2005 plugin here" href="http://www.sharpsoft.net/blogmycode.aspx"&gt;BlogMyCode VS2005 plugin here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-5070334791713340781?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/5070334791713340781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=5070334791713340781&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5070334791713340781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5070334791713340781'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/03/blogmycode-vs2005-plugin.html' title='BlogMyCode VS2005 plugin'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-2422285497569759693</id><published>2008-03-10T08:23:00.001-06:00</published><updated>2008-03-10T08:23:20.012-06:00</updated><title type='text'>Using SQL Database images in the ASP.NET ReportViewer</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br /&gt;One of the criteria for a project was for the user to input data into the database for viewing in a report. The user entered data, and uploaded an image for the report. Now, I've added images to an SQL database before. But years and years ago, way back when there wasn't an 'image' type for a field in SQL. Instead, I believe the type for the field was called 'binary' or something along those lines. The process for inserting an image into an MSSQL image field is a little different than it was before.&lt;br /&gt;&lt;br /&gt;I start off with the ASP.NET System.Web.UI.WebControls.FileUpload control for uploading a file through the web page. Back in the ASP days, there wasn't a process for this built into ASP, so we had to 1) buy a DLL for doing this or 2) make a DLL for doing this. Either way, it wasn't integrated, and required either and ActiveX control or a Java applet to get the job done.&lt;br /&gt;&lt;br /&gt;The data the user entered was to be available in a report created in ReportViewer. The Reporting Services report has an image object, which has the option for defining it as a database image, and define the field in the database that has the image. Now, the implication is that one would have to define the field and the report would get the data, and display the image. Easy as pie. But the reality is something wholly different. After days on end of searching and searching and reading forum posts and tutorials ad-infinitum, I finally found (although I have to admit, I don't know where now) that it isn't as simple and easy as they let on. You can't just put:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;=Fields!ImageField.Value&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;and have it display an image. No. The report must start with a string for the image, and then the report converts that string to an image. So the question becomes 'how do I get the the data into string format?' Oddly, you have to convert the data to base 64 string, then convert it FROM base 64 string. I don't know why, but I do know this works.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;=System.Convert.FromBase64String(System.Convert.ToBase64string(Fields!ImageField.Value))&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I don't pretend to know why this is the way it is, but I know that it works, and the image appears. And frankly, since I know how to make it work, I don't really care why I have to do it. Oh, crap, I almost forgot. To use the source Database for a report, you've got to set the MIMEType to either image/jpg, image/png or image/bmp. Again, I don't know why this is, I just know that it is, and that is enough for me.&lt;br /&gt;&lt;br /&gt;I spent oodles of time trying to get the image to display, but it just seemed like it would never ever work properly. Finally, I decided to create a quick and dirty (and extremely ugly) desktop application where I would pull the image from the database and assign it to a PictureBox control. What I found was as I would pull the image out of the database, and using a MemoryStream to convert it to an actual image.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlCommand&lt;/span&gt; cmd = &lt;span style='color: #0000ff'&gt;new&lt;/span&gt; System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlCommand&lt;/span&gt;();&lt;br /&gt;cmd.CommandText = &lt;span style='color: #cc0033'&gt;"SELECT * FROM [REPORT_TABLE]"&lt;/span&gt;;&lt;br /&gt;System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlConnection&lt;/span&gt; conn = &lt;span style='color: #0000ff'&gt;new&lt;/span&gt; System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlConnection&lt;/span&gt;();&lt;br /&gt;conn.ConnectionString = _connectionString;&lt;br /&gt;cmd.Connection = conn;&lt;br /&gt;System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlDataAdapter&lt;/span&gt; da = &lt;span style='color: #0000ff'&gt;new&lt;/span&gt; System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlDataAdapter&lt;/span&gt;(cmd.CommandText, conn);&lt;br /&gt;&lt;span style='color: #0099ff'&gt;DataSet&lt;/span&gt; ds = &lt;span style='color: #0000ff'&gt;new&lt;/span&gt; &lt;span style='color: #0099ff'&gt;DataSet&lt;/span&gt;();&lt;br /&gt;da.Fill(ds);&lt;br /&gt;&lt;span style='color: #0099ff'&gt;DataRow&lt;/span&gt; dr = ds.Tables[0].Rows[0];&lt;br /&gt;&lt;span style='color: #0099ff'&gt;Byte[]&lt;/span&gt; b = (&lt;span style='color: #0099ff'&gt;Byte[]&lt;/span&gt;)dr[&lt;span style='color: #cc0033'&gt;"IMAGEFIELD"&lt;/span&gt;];&lt;br /&gt;MemoryStream ms = new MemoryStream(b);&lt;br /&gt;this.pictureBox1.Image = Image.FromStream(ms);&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This code, while it appears on the surface that it should work, didn't. It would kick out the ambiguous "Parameter is not valid" error message at the "Image.FromStream(ms)" line. After several days of googleing and reading what was said by others regarding this error, I discovered that my code was syntactically correct and there was no real reason why it wasn't working. That is when it hit me. I wonder if I'm putting the data into the database correctly?&lt;br /&gt;&lt;br /&gt;For inserting the data, at first I was using a stored procedure, through an SqlDataSource and it appeared to be working. That is to say, it didn't kick out any errors. Then I figured I would just go through the process of creating the SqlDataSource and, for lack of a better description, manually insert the data. Again, this seemed to work fine. No errors. But still the image was not visible in the report, and in my desktop application, it would error when trying to create the image "FromStream(Stream stream)". This got me to thinking, so I took a step back and instead of using the SqlDataSource, I decided to try using System.Data.SqlClient to insert the data and image. And lo' and behold this method worked. I don't know what is funky with SqlDataSource method, but what I know is that it didn't work - but that using SqlClient does work, and that is all that really matters to me.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style='color: #0099ff'&gt;string&lt;/span&gt; uploadFileName = &lt;span style='color: #0099ff'&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;&lt;span style='color: #0099ff'&gt;byte[]&lt;/span&gt; imageBytes = &lt;span style='color: #0000ff'&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span style='color: #0000ff'&gt;if&lt;/span&gt;(imageUpload != &lt;span style='color: #0000ff'&gt;null&lt;/span&gt;&amp;amp;&amp;amp; imageUpload.HasFile)&lt;br /&gt;{&lt;br /&gt;    uploadFileName = imagUpload.FileName;&lt;br /&gt;    imageBytes = imageUpload.FileBytes;&lt;br /&gt;}&lt;br /&gt;System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlCommand&lt;/span&gt; cmd = new System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlCommand&lt;/span&gt;();&lt;br /&gt;System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlConnection&lt;/span&gt; conn = new System.Data.SqlClient.&lt;span style='color: #0099ff'&gt;SqlConnection&lt;/span&gt;();&lt;br /&gt;conn.ConnectionString = _connectionString;&lt;br /&gt;cmd.CommandText = &lt;span style='color: #cc0033'&gt;"INSERT INTO REPORT_TABLE (IMAGEFIELD,IMAGENAME) VALUES (@image,@filename)"&lt;/span&gt;;&lt;br /&gt;cmd.Parameters.Add(&lt;span style='color: #cc0033'&gt;"@image"&lt;/span&gt;, &lt;span style='color: #0099ff'&gt;SqlDbType&lt;/span&gt;.Image, imageBytes.Length).Value = imageBytes;&lt;br /&gt;cmd.Parameters.Add(&lt;span style='color: #cc0033'&gt;"@filename"&lt;/span&gt;, &lt;span style='color: #0099ff'&gt;SqlDbType&lt;/span&gt;.VarChar, 50).Value = uploadFileName;&lt;br /&gt;cmd.Connection = conn;&lt;br /&gt;conn.Open();&lt;br /&gt;cmd.ExecuteNonQuery();&lt;br /&gt;conn.Close();&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now, just inserting the imageBytes object into the command text did not work. I had to add it as a Parameter to the SqlCommand object. Why? Hell, I don't know, but I know it works, and that is what counts for me at this point. So I put added 23 parameters to the Command object (one for each column of course) and set the values accordingly&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;cmd.Parameters.Add(&lt;span style='color: #cc0033'&gt;"@image"&lt;/span&gt;, &lt;span style='color: #0099ff'&gt;SqlDbType&lt;/span&gt;.Image, _imageBytes.Length).Value = _imageBytes;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This put the image into the database properly. I'm guessing the parameter is required because it actually defines exactly what DBType we are dealing with, where an normal insert statement wouldn't. At any rate it WORKS! Now the image goes into the database, and get extracted by the ReportViewer and displays properly in the report.&lt;br /&gt;&lt;br /&gt;w00t!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;br /&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/ASP.NET' class='performancingtags'&gt;ASP.NET&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/MS SQL' class='performancingtags'&gt;MS SQL&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/ReportViewer' class='performancingtags'&gt;ReportViewer&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Database Image' class='performancingtags'&gt;Database Image&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/SqlDbType.Image' class='performancingtags'&gt;SqlDbType.Image&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-2422285497569759693?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/2422285497569759693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=2422285497569759693&amp;isPopup=true' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2422285497569759693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2422285497569759693'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/03/using-sql-database-images-in-aspnet.html' title='Using SQL Database images in the ASP.NET ReportViewer'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-1637469532435158175</id><published>2008-02-20T13:19:00.001-06:00</published><updated>2008-02-20T13:19:32.801-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ReportViewer'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Reports'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='DrillthroughEventArgs'/><category scheme='http://www.blogger.com/atom/ns#' term='Drill Down Reports'/><title type='text'>Drill through reports in ASP.NET</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;In a recent ASP.NET application (coded in C# - natch) I had the cause to create a report, which contained a hyper link which in turn displayed a second report based on data from the first report. In researching this, I discovered this is called a drill through report.&lt;br/&gt;&lt;br/&gt;I found information at &lt;a target='_blank' href='http://www.codeproject.com/KB/aspnet/DrillThroughReport.aspx'&gt;CodeProject.com&lt;/a&gt; regarding drill down reports. The difference between what Shirley did, and what I was doing is that I already had the dataset for the report created. I created a dataset with two data tables in it. I haven't tried it, but I'm guessing that I could have easily put as many tables as I needed if I were going to drill down farther than just one level.&lt;br/&gt;&lt;br/&gt;I used the same dataset for both reports. But when I went to perform the drill down, I received the following error:&lt;br/&gt;&lt;blockquote&gt;"A data source instance has not been supplied for the data source [report data source name]"&lt;/blockquote&gt;&lt;br/&gt;So I slap my forehead, call my self a dunce, and make sure that both tables are represented by data sources (or would that be data sourcii?). At any rate, I kept getting the same error, which is what led me to googling the error message to see what the problem is. Based on Shirley's article, I realized that I would be required to set the data source for the new report in the ReportViewer_Drillthrough event handler.&lt;br/&gt;&lt;br/&gt;Here is my code:&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;font face='Courier New' color='#3366ff'&gt;protected void&lt;/font&gt;&lt;font face='Courier New'&gt; ReportViewer_Drillthrough(&lt;/font&gt;&lt;font face='Courier New' color='#3366ff'&gt;object&lt;/font&gt;&lt;font face='Courier New'&gt; sender, Microsoft.Reporting.WebForms.&lt;/font&gt;&lt;font face='Courier New' color='#339999'&gt;DrillthroughEventArgs&lt;/font&gt;&lt;font face='Courier New'&gt; e)&lt;br/&gt;{&lt;br/&gt;    Microsoft.Reporting.WebForms.&lt;/font&gt;&lt;font face='Courier New' color='#339999'&gt;LocalReport&lt;/font&gt;&lt;font face='Courier New'&gt; localReport = (Microsoft.Reporting.WebForms.&lt;/font&gt;&lt;font face='Courier New' color='#339999'&gt;LocalReport&lt;/font&gt;&lt;font face='Courier New'&gt;)e.Report;&lt;br/&gt;    localReport.DataSources.Clear();&lt;br/&gt;    &lt;font color='#3366ff'&gt;this&lt;/font&gt;.ObjectDataSource3.SelectParameters[0].DefaultValue = e.Report.GetParameters()[0].Values[0].ToString().Trim();&lt;br/&gt;    Microsoft.Reporting.WebForms.&lt;/font&gt;&lt;font face='Courier New' color='#339999'&gt;ReportDataSource&lt;/font&gt;&lt;font face='Courier New'&gt; rds = &lt;font color='#3366ff'&gt;new&lt;/font&gt; Microsoft.Reporting.WebForms.&lt;/font&gt;&lt;font face='Courier New' color='#339999'&gt;ReportDataSource&lt;/font&gt;&lt;font face='Courier New'&gt;(&lt;/font&gt;&lt;font face='Courier New' color='#990000'&gt;"ReportDataSet_TABLE"&lt;/font&gt;&lt;font face='Courier New'&gt;,&lt;/font&gt;&lt;font face='Courier New' color='#3366ff'&gt;this&lt;/font&gt;&lt;font face='Courier New'&gt;.ObjectDataSource3.Select());&lt;br/&gt;    localReport.DataSources.Add(rds);&lt;br/&gt;}&lt;/font&gt;&lt;/pre&gt;&lt;br/&gt;A bit of breakdown for those who have a hard time following my crappy coding style:&lt;br/&gt;First off, I set a LocalReport object ot the DrillthroughEventArgs.Report object. Then I clear the data sources because I'm going to add a new one, and I certainly don't want the report getting confused. I set the default value of the SelectParameters[0] (the only parameter for this report) to the only parameter that is passed. If there are more parameters in your report, then you would, of course, be required to set them all. For this instance, I had only one.&lt;br/&gt;&lt;br/&gt;Then I had to create a new ReportDataSource object. At first I tried simply added the ObjectDataSource3 to my localReport.DataSources, but that didn't fly because I guess an ObjectDataSource is different from a ReportDataSource. Then I figured I would just cast the ObjectDataSource as a ReportDataSource. But that didn't fly either. You can't cast the former as the latter. So I was resigned to create a new one. I gave the new one the same name as the DataSource I defined in my report. Then I added the ReportDataSource to my localReport.DataSources collection, and voila!&lt;br/&gt;&lt;br/&gt;Oh, and don't try to refresh the localReport. For some reason it seems to resort back to the parent report. I don't know why, and frankly don't really care, as long as I know how to handle it, it's all good.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;br/&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/ReportViewer' class='performancingtags'&gt;ReportViewer&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/ASP.NET' class='performancingtags'&gt;ASP.NET&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/DrillthroughEventArgs' class='performancingtags'&gt;DrillthroughEventArgs&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Drill%20Down%20Reports' class='performancingtags'&gt;Drill Down Reports&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/ASP%20Reports' class='performancingtags'&gt;ASP Reports&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/SQL%20Reports' class='performancingtags'&gt;SQL Reports&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-1637469532435158175?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/1637469532435158175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=1637469532435158175&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1637469532435158175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1637469532435158175'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/02/drill-through-reports-in-aspnet.html' title='Drill through reports in ASP.NET'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-363813411630805725</id><published>2008-02-04T15:26:00.000-06:00</published><updated>2008-02-04T15:33:05.747-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckBoxList'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Working Client-Side with CheckBoxLists</title><content type='html'>One of the new things I have been playing with are CheckBoxLists. This is a server control which is DataBindable. It creates a list of CheckBox controls. You can define if the list is displayed horizontally, or vertically. I am using a couple of these in a new application and ran into some problems accessing them with JavaScript. This application doesn't ever do a real-honest-to-goodness postback. Instead, all calls to the server are handled through Callbacks. Callbacks aren't really what I'm here to talk about, so if you need to learn more about them, I would recommend popping on over to ASP.NET and checking out their forums and other areas of that site. It is chock full of excellent information.&lt;br /&gt;&lt;br /&gt;Ok, back to where I was. Getting to the CheckBoxList stuff. The CheckBoxList renders its ID on the HTML side slightly different from a normal control. Since the control generates multiple sub-controls. For instance, normally, if you had a CheckBox and gave it the ID of "myCheckBox" then to access it in JavaScript you'd simply do something like var chkbx = document.getElementById('&lt;%=myCheckBox.ClientID %&gt;'); and voila! you have access to your CheckBox control. But as stated, the CheckBoxList generates multiple CheckBoxes. The problem was how in the world do I access these? How do I do capture a client side event with a databound list like this? I mean, the list could change daily right? What I came up with (and it probably isn't the _best_ way to go about it, but it certainly works) is to add an attribute to the generated CheckBox in the DataBound EventHandler for the CheckBoxList control. Using DataBound of course because that means the list has been completed.&lt;br /&gt;&lt;br /&gt;The CheckBoxList, like the DropDownList (and several other controls) contains the .Items parameter which is the ListItemCollection object. What I ended up doing is adding an "onclick" attribute to each item, passing to the JavaScript the client id of the actual CheckBox control, the text and the value (really, I only needed the control client id and the text, but I figured I'd go ahead and throw in the value for good measure.  I separated the ClientID, Text and Value data with a colon (:) so I could easily split it back on the client side.&lt;br /&gt;&lt;br /&gt; &lt;pre&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;protected void&lt;/span&gt; checkBoxList_DataBound(&lt;span style="color: rgb(51, 51, 255);"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(51, 51, 255);"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt; &lt;span style="color: rgb(0, 204, 204);"&gt;CheckBoxList&lt;/span&gt; cbl = (&lt;span style="color: rgb(51, 153, 153);"&gt;CheckBoxList&lt;/span&gt;)sender;&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(51, 51, 255);"&gt;int &lt;/span&gt;i = 0; i &lt; style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt; controlName = cbl.ClientID + &lt;span style="color: rgb(153, 51, 0);"&gt;"_"&lt;/span&gt; + i;&lt;br /&gt;     cbl.Items[i].Attributes.Add(&lt;span style="color: rgb(153, 51, 0);"&gt;"onclick"&lt;/span&gt;, &lt;span style="color: rgb(153, 51, 0);"&gt;"&lt;span style="text-decoration: underline;"&gt;javascript:checkBoxChanged&lt;/span&gt;('"&lt;/span&gt; + controlName + &lt;span style="color: rgb(153, 51, 0);"&gt;":"&lt;/span&gt; + cbl.Items[i].Text + &lt;span style="color: rgb(153, 51, 0);"&gt;":"&lt;/span&gt; + cbl.Items[i].Value + &lt;span style="color: rgb(153, 51, 0);"&gt;"')"&lt;/span&gt;);&lt;br /&gt;     cbl.Items[i].Selected = &lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;;&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I use the same DataBound Event Handler for all of the CheckBoxList controls since there is nothing happening that is actually specific to any one CheckBoxList, they all call the same JavaScript. However, getting the control information, and whether or not it is checked, back to the client side is only half the battle. The check boxes are part of a data filter which will display data in a GridView. The user can click on or off all or part of the list items to decrease or expand the scope of the data displayed. So I need to put these checked boxes into some kind of JavaScript array so that when the time comes to do the Callback to populate the GridView, I have all the required data to build the filter server-side.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; checkedBoxesArray = &lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; Array();&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;function&lt;/span&gt; checkBoxChanged(controlInfo) {&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; ary = controlInfo.split(":");&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; chkBx = document.getElementById(ary[0]);&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt;(chkBx.checked) {&lt;br /&gt;     &lt;span style="color: rgb(0, 153, 0);"&gt;// check to see if the check box already exists (it shouldn't)&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;for&lt;/span&gt;(x &lt;span style="color: rgb(51, 51, 255);"&gt;in&lt;/span&gt; checkedBoxesArray) {&lt;br /&gt;        &lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt;(controlInfo == checkedBoxesArray[x]) &lt;span style="color: rgb(51, 51, 255);"&gt;return&lt;/span&gt;; &lt;span style="color: rgb(0, 153, 0);"&gt;// &lt;-- get out of here, it's already there, and there is nothing else to do&lt;/span&gt;&lt;br /&gt;     }&lt;br /&gt;     checkedBoxesArray[checkedBoxesArray.length+1] = controlInfo;&lt;br /&gt;  }&lt;span style="color: rgb(51, 51, 255);"&gt;else&lt;/span&gt; {&lt;br /&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;for&lt;/span&gt;(x &lt;span style="color: rgb(51, 51, 255);"&gt;in&lt;/span&gt; checkedBoxesArray) {&lt;br /&gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;// find the checkbox information in the array and remove it (it should be there)&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: rgb(51, 51, 255);"&gt;if &lt;/span&gt;(controlInfo == checkedBoxesArray[x]) {&lt;br /&gt;           checkedBoxesArray.splice(x,1);&lt;br /&gt;           &lt;span style="color: rgb(51, 51, 255);"&gt;break&lt;/span&gt;; &lt;span style="color: rgb(0, 153, 0);"&gt;// &lt;-- No use going through all of them if we don't have to , right?&lt;/span&gt;&lt;br /&gt;        }&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then I could access the checkedBoxesArray in the JavaScript function which actually creates the querystring style callback event arguments which are used on the server-side to create the data filter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-363813411630805725?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/363813411630805725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=363813411630805725&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/363813411630805725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/363813411630805725'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/02/working-client-side-with-checkboxlists.html' title='Working Client-Side with CheckBoxLists'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-4470652932673996735</id><published>2008-01-07T09:08:00.000-06:00</published><updated>2008-01-07T09:11:57.858-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XP'/><category scheme='http://www.blogger.com/atom/ns#' term='UNC'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Network Share'/><title type='text'>XP does not support hosting on a UNC share?</title><content type='html'>&lt;rantmode&gt;&lt;br /&gt;It occurs to me that for nearly a decade now Microsoft has been championing the 'thin client.' Saying things like "the network is the OS" and wanting businesses, developers and others to move to heavy-hitting powerful server platforms that would contain most of the programs and information, and the users would have more watered down desktops which would access most of their applications (office, mail, etc) from the server.&lt;br /&gt;&lt;br /&gt;So imagine my shock, surprise and stream of words filthy enough to make a sailor blush when I kept getting this error while trying to publish a website:&lt;br /&gt;&lt;/rantmode&gt;&lt;blockquote&gt;Error    5    An error occurred loading a configuration file: Failed to start monitoring changes to '\\[machinename]\[drive]$\[directory]\[website]\bin\ko' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform.    &lt;/blockquote&gt;&lt;br /&gt;WTF? Hosting on a UNC share is not supported? How the hell can this be? Microsoft touts how Visual Studio 2005 is such a great development platform. How collaboration and all that jazz is great and easy and built right into it. What kind of crack are they smoking? If hosting on a UNC is not supported, how in God's green earth are we supposed to develop web applications? On our desktops? Sure, ok, but what about all that great built-in collaboration? Oh, I guess that baby gets thrown out with the bathwater in this one.&lt;br /&gt;&lt;br /&gt;What makes things worse is that this seems to be a rather sporadic error. On top of that, I can run the publish command, get this error with a fold like "ko" (as above) and run it again, making no changes, and it gives me a different folder. Seems almost totally random. Thankfully, all the folders it was complaining about were either 1) localization folders added by their AJAX control toolkit, or 2) App_Theme folders that we weren't using anyway. So I was able to delete all those without causing undue issues with the site.&lt;br /&gt;&lt;br /&gt;Checking the KB article the error instructs you to (&lt;a href="http://support.microsoft.com/?kbid=810886"&gt;http://support.microsoft.com/?kbid=810886&lt;/a&gt;) doesn't really do much for me. First off, the development server we are using didn't have these keys at all in their registry.  The KB article is for windows 2000 server, and we are using Windows Server 2k3. So this article is pointless. Every Google find points back to the same damn MS KB article.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:180%;" &gt;AAAAAAAAARRRRRRRGGGGGHHHHHHH!!!!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I just had to rant a bit.&lt;br /&gt;Sorry.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-4470652932673996735?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/4470652932673996735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=4470652932673996735&amp;isPopup=true' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4470652932673996735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4470652932673996735'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2008/01/xp-does-not-support-hosting-on-unc.html' title='XP does not support hosting on a UNC share?'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-8744249161285048082</id><published>2007-12-19T12:34:00.001-06:00</published><updated>2007-12-19T12:45:35.026-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ArcIMS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS 9.2'/><category scheme='http://www.blogger.com/atom/ns#' term='WebADF'/><category scheme='http://www.blogger.com/atom/ns#' term='ESRI'/><title type='text'>Getting the map to zoom to a feature in ESRI webADF is a chore</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;ESRI can be as frustrating as it can get. My lack of experience with ASP.NET 2.0/3.0 combined with the vast differences betwen the desktop functionality of ArcGIS and the web functionality of ArcIMS / WebADF is giving me gray hair faster then my kids every could dream of doing.&lt;br /&gt;&lt;br /&gt;I have a .NET pretty much out of the box site - that is, I went into "ArcIMS Web Manager for the Microsoft .NET Framework" and setup a new site. I have some queries that had to be customized, and I ran out of time trying to get the TaskResults panel to display the query results (I'll post about that experience when I have a little more time), so I put them in an HTML table in their own panel. I have a hyperlink in the table which, when clicked, should zoom to that feature on the map. I have looked and, and am using some code from this thread &lt;a target="_blank" href="http://forums.esri.com/Thread.asp?c=64&amp;amp;f=1333&amp;amp;t=233315&amp;amp;mc=17"&gt;how can i zoom to my selected features &lt;/a&gt; - only it isn't working fully.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// This is the method to zoom to the feature, param 'key' is the objectid of the feature, and the param 'layer' is the name of the feature layer&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;protected void&lt;/span&gt; ZoomToFeature(&lt;span style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt; key, &lt;span style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt; layer)&lt;br /&gt;{&lt;br /&gt;ESRI.ArcGIS.ADF.Web.DataSources.IMS.&lt;span style="color: rgb(102, 204, 204);"&gt;MapFunctionality&lt;/span&gt; mf;&lt;br /&gt;ESRI.ArcGIS.ADF.IMS.Carto.&lt;span style="color: rgb(102, 204, 204);"&gt;MapView&lt;/span&gt; mv;&lt;br /&gt;mf = (ESRI.ArcGIS.ADF.Web.DataSources.IMS.&lt;span style="color: rgb(102, 204, 204);"&gt;MapFunctionality&lt;/span&gt;)Map1.GetFunctionality(0);&lt;br /&gt;mv = mf.MapView;&lt;br /&gt;ESRI.ArcGIS.ADF.IMS.Carto.Layer.&lt;span style="color: rgb(102, 204, 204);"&gt;FeatureLayer&lt;/span&gt; queryLayer;&lt;br /&gt;queryLayer = (&lt;span style="color: rgb(102, 204, 204);"&gt;FeatureLayer&lt;/span&gt;)mv.Layers.FindByName(layer);&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;Filter&lt;/span&gt; queryFilter = &lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(102, 204, 204);"&gt;Filter&lt;/span&gt;();&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;QueryParameters&lt;/span&gt; queryParams = &lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(102, 204, 204);"&gt;QueryParameters&lt;/span&gt;(queryFilter);&lt;br /&gt;queryFilter.WhereExpression = &lt;span style="color: rgb(204, 102, 0);"&gt;"ObjectID = '"&lt;/span&gt; + key + &lt;span style="color: rgb(204, 102, 0);"&gt;"'"&lt;/span&gt;;&lt;br /&gt;queryFilter.Tolerance = 20;&lt;br /&gt;queryFilter.ToleranceUnits = BufferUnits.Meters;&lt;br /&gt;queryParams.ReturnGeometries = &lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;;&lt;br /&gt;queryParams.ReturnGlobalEnvelope = &lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;;&lt;br /&gt;ESRI.ArcGIS.ADF.IMS.Display.Symbol.&lt;span style="color: rgb(102, 204, 204);"&gt;FeatureSymbol&lt;/span&gt; fs = new ESRI.ArcGIS.ADF.IMS.Display.Symbol.&lt;span style="color: rgb(102, 204, 204);"&gt;SimpleFillSymbol&lt;/span&gt;(System.Drawing.&lt;span style="color: rgb(102, 204, 204);"&gt;Color&lt;/span&gt;.White, System.Drawing.&lt;span style="color: rgb(102, 204, 204);"&gt;Color&lt;/span&gt;.Red, ESRI.ArcGIS.ADF.IMS.Display.Symbol.&lt;span style="color: rgb(102, 204, 204);"&gt;PolygonFillType&lt;/span&gt;.Solid);&lt;br /&gt;ESRI.ArcGIS.ADF.IMS.Display.Renderer.&lt;span style="color: rgb(102, 204, 204);"&gt;SimpleRenderer&lt;/span&gt; sr = new ESRI.ArcGIS.ADF.IMS.Display.Renderer.&lt;span style="color: rgb(102, 204, 204);"&gt;SimpleRenderer&lt;/span&gt;(fs);&lt;br /&gt;queryLayer.Visible = &lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;FeatureTable&lt;/span&gt; ft = queryLayer.Query(queryParams);&lt;br /&gt;if (ft.Rows.Count &amp;amp;gt; 0)&lt;br /&gt;{&lt;br /&gt; ESRI.ArcGIS.ADF.IMS.Geometry.&lt;span style="color: rgb(102, 204, 204);"&gt;Geometry&lt;/span&gt; featureGeom = (ESRI.ArcGIS.ADF.IMS.Geometry.&lt;span style="color: rgb(102, 204, 204);"&gt;Geometry&lt;/span&gt;)ft.Rows[0][&lt;span style="color: rgb(204, 102, 0);"&gt;"#SHAPE#"&lt;/span&gt;];&lt;br /&gt; ESRI.ArcGIS.ADF.Web.Geometry.&lt;span style="color: rgb(102, 204, 204);"&gt;Geometry&lt;/span&gt; adfGEom = ESRI.ArcGIS.ADF.Web.DataSources.IMS.&lt;span style="color: rgb(102, 204, 204);"&gt;Converter&lt;/span&gt;.ToADFGeometry(featureGeom);&lt;br /&gt; ESRI.ArcGIS.ADF.Web.Geometry.&lt;span style="color: rgb(102, 204, 204);"&gt;Envelope&lt;/span&gt; adfEnv = ESRI.ArcGIS.ADF.Web.Geometry.&lt;span style="color: rgb(102, 204, 204);"&gt;Envelope&lt;/span&gt;.GetMinimumEnclosingEnvelope(adfGEom);&lt;br /&gt; Map1.Extent = adfEnv;&lt;br /&gt;}&lt;br /&gt;Map1.Refresh();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This is the code in RaiseCallbackEvent(string responseString) method which calls the ZoomToFeature method&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.ZoomToFeature(eventArg, layerArg);&lt;br /&gt;response = Map1.CallbackResults.ToString();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I am getting new envelope for the feature, and I am setting the map extents to that envelope. I know this works because I put some dummy code in a Map1_ExtentsChanged event handler and checked to ensure the map extents were changed. Then I hit Map1.Refresh(); but the map does not change. I'm returning the Map1.CallBackResults.ToString();, but I'm ignorant of what to do with the results on the client side. The RaiseCallbackEvent method returns the 'response' string.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After playing around and doing some more searching with different keywords, I found this thread; &lt;a target="_blank" href="http://forums.esri.com/Thread.asp?c=64&amp;amp;f=1333&amp;amp;t=229330&amp;amp;mc=7#msgid697622"&gt;The ESRI Map control does not refresh ..... &lt;/a&gt; which talks about client side map.redraw(); giving the following example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; map = Maps[&lt;span style="color: rgb(204, 102, 0);"&gt;'&lt;%=Map1.ClientID %&gt;'&lt;/span&gt;];&lt;br /&gt;map.redraw();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I thought this would solve my problem and it almost-but-not-quite does. It does redraw the map (at least it looks like it does). But what I get is a completely blank map until I either zoom in or out. Then the map appears zoomed to roughly the correct location (depending on if I zoomed in or out to make it show up). Also works using the mouse wheel.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tag/ESRI" class="performancingtags"&gt;ESRI&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/WebADF" class="performancingtags"&gt;WebADF&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/ArcIMS" class="performancingtags"&gt;ArcIMS&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/ASP.NET" class="performancingtags"&gt;ASP.NET&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/C#" class="performancingtags"&gt;C#&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-8744249161285048082?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/8744249161285048082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=8744249161285048082&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8744249161285048082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8744249161285048082'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/12/getting-map-to-zoom-to-feature-in-esri.html' title='Getting the map to zoom to a feature in ESRI webADF is a chore'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-4171790780987115941</id><published>2007-12-13T06:22:00.001-06:00</published><updated>2007-12-13T06:22:38.196-06:00</updated><title type='text'>I might be going crazy</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;This is getting more annoying by the fracking minute!!!!!!!!&lt;br/&gt;&lt;br/&gt;I need a search with cascading combo boxes. That is, when the search panel is displayed, combobox1 is populated, and combobox2 is empty. When the user selects a value from combobox1, it then populates combobox2 with values based on combobox1. Simple enough right? I get that population of the boxes down pat, no problems there. Doing through Callback and everything so the page doesn't have to refresh or anything like that.&lt;br/&gt;&lt;br/&gt;Here is my problem. I need the results to display in the ESRI.ArcGIS.ADF.Web.UI.WebControls.TaskResults results panel - we'll call it TaskResults1 (because that is what it is called when the site is created through the ESRI ArcIMS manager). I have tried just putting the code in there, but to no avail. I have tried creating a QueryAttributesTask and defaulting the values to what I need, and executing the task. Still no dice.&lt;br/&gt;&lt;br/&gt;The values get put into the TaskResults1 results, but they just don't display. I can't figure why they don't display. I know they are there because after I perform the query, if I do a canned search, or use the MapIdentify feature (both of which add data to the TaskResults1 container), the results display with the new data.&lt;br/&gt;&lt;br/&gt;I have tried finding help on the ESRI forums, but that is slow and I'm on a deadline.&lt;br/&gt;&lt;br/&gt;I'll keep trying different wild and crazy stuff to see if I can figure it out.&lt;br/&gt;&lt;br/&gt;Hmmmm....I wonder if I can refresh the TaskResults1 container from client side java?&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-4171790780987115941?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/4171790780987115941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=4171790780987115941&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4171790780987115941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4171790780987115941'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/12/i-might-be-going-crazy.html' title='I might be going crazy'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-6457831885139114135</id><published>2007-10-29T12:31:00.001-06:00</published><updated>2007-10-29T12:31:13.365-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 2'/><category scheme='http://www.blogger.com/atom/ns#' term='ArcGIS 9.2'/><category scheme='http://www.blogger.com/atom/ns#' term='ESRI'/><title type='text'>ESRI 9.2 lacks info regarding VS 2005</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;small&gt;ESRI seems to like to play things very close to the vest - so to speak. It is difficult to find information on just about anything dealing with creating class libraries in .NET to work with ArcGIS 9.2, even though they tout that 9.2 is built on the .NET Framework 2.0. So far, 99% of the articles, tutorials or help I have found have been for pre-9.2 and VS 2003 (Framework 1.1).&lt;br/&gt;&lt;br/&gt;To be fair, I have found a few PDF files discussing 9.2 and .NET 2.0, but that is about it. They are actually PDFs made from PowerPoint slides that I'm certain were from some conference or demonstration given probably a year or so ago. But the walkthroughs they have on their site for VS 2003 - which seem exceptional in detail - are conspicuously missing for VS 2005. Everything I have found that deals with VS 2005 centers around the ArcGIS SDK which , of course, didn't get installed on my system along with ArcGIS 9.2, and is not downloadable from ESRI - which I find strange. It seems to me that other companies make their SDK readily available to developers, but ESRI doesn't seem to want to play that game for some reason.&lt;br/&gt;&lt;br/&gt;So here I am, about a week into the project. I've got most of the VBA code translated, but I can't test any of it because I can't get the crap to work properly in ArcMap, and I can't find any decent assistance on the 'net. I guess I'm going to have to go be the quintessential n00b at the ESRI forums and beg for some sort of help. I hate doing that, but, like Duke Wayne said "A man's gotta do what a man's gotta do" ( or someone said that anyway ).&lt;br/&gt;&lt;br/&gt;Here are the walkthrough/tutorials that I found pertaining to ESRI and .NET if anyone is interested/needs them:&lt;br/&gt;&lt;/small&gt;&lt;ul&gt;&lt;li&gt;&lt;small&gt;&lt;a href='http://edndoc.esri.com/arcobjects/9.0/ArcGISDevHelp/DevelopmentEnvs/DotNet/Walkthrough1CS.htm'&gt;Walkthrough 1 C#: Creating a simple command for  ArcMap&lt;/a&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;a href='http://edndoc.esri.com/arcobjects/9.0/ArcGISDevHelp/DevelopmentEnvs/DotNet/Walkthrough2CS.htm'&gt;Walkthrough 2 C#: Creating a command that inherits from BaseCommand&lt;/a&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;a href='http://edndoc.esri.com/arcobjects/9.0/ArcGISDevHelp/DevelopmentEnvs/DotNet/Walkthrough3CS.htm'&gt;Walkthrough 3 C#: Using a Windows Form to create a DockableWindow  for ArcMap&lt;/a&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;a href='http://edndoc.esri.com/arcobjects/9.2/NET/01c01659-cdf8-4579-9c87-2b965e872d84.htm'&gt;Create a command by inheriting from BaseCommand&lt;/a&gt;&lt;/small&gt;&lt;/li&gt;&lt;/ul&gt;&lt;small&gt;&lt;br/&gt;The way I'm looking at this right now, It seems like it would be infinitely easier to create a desktop app and add the ArcMap to the app, instead of trying to create modules to run in ArcMap. But that isn't the way things are right now, so I've gotta do what they want done.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;br/&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/ESRI' class='performancingtags'&gt;ESRI&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/ArcGIS%209.2' class='performancingtags'&gt;ArcGIS 9.2&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/.NET%20Framework%202' class='performancingtags'&gt;.NET Framework 2&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/C#' class='performancingtags'&gt;C#&lt;/a&gt;&lt;/small&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-6457831885139114135?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/6457831885139114135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=6457831885139114135&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6457831885139114135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6457831885139114135'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/10/esri-92-lacks-info-regarding-vs-2005.html' title='ESRI 9.2 lacks info regarding VS 2005'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-1268652613031354168</id><published>2007-10-17T08:50:00.000-06:00</published><updated>2007-10-17T08:53:53.346-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ArcView'/><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><title type='text'>Converting VBA code to .Net</title><content type='html'>My latest &lt;strike&gt;torture&lt;/strike&gt; assignment is to convert legacy VBA code in ArcView applications to the .NET Framework. I haven't decided yet if I will convert them to VB .NET or C#, but since I like the C# language better, I will probably attempt to convert them to C#. But then, that somewhat depends on ArcView and how it handles these things. I haven't much (any) experience with ArcView so this is all new territory to me.&lt;br /&gt;&lt;br /&gt;I did find a couple of somewhat useful links regarding converting VBA to .NET:&lt;br /&gt;&lt;br /&gt;&lt;a style="font-size: x-large; font-weight: bold;" href="http://msdn2.microsoft.com/en-us/library/Aa192490%28office.11%29.aspx" target="_blank"&gt;Converting Code from VBA to Visual Basic .NET&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-size: x-large; font-weight: bold;" href="http://blogs.gotdotnet.com/pstubbs/archive/2004/01/15/59049.aspx" target="_blank"&gt;Convert VBA to VB .Net and C#&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found this VBA script which purports to export VBA modules, class modules and forms associated with an ArcView document to a separate folder. I haven't tried it yet as I won't get ArcView loaded until tomorrow. But I'm certainly going to give it a go. Anything to make things easier!&lt;br /&gt;&lt;br /&gt;&lt;a style="font-size: x-large; font-weight: bold;" href="http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Application_Framework/fccb7b03-bf70-4104-89dc-fd0c1141cffe.htm" target="_blank"&gt;Export VBA Code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Okay, I don't know if the module will work at any rate because we can't compile the ArcView project here. I tapped another developer who actually has ArcView on her machine and we were going to run this module, but the guy who created this project has referenced some Autodesk stuff, which we don't have. So we have to export the modules,classes and forms one at a time. There are quite a few of them there.&lt;br /&gt;&lt;br /&gt;I'll keep you posted on what entails with converting the VBA to C# code as this endeavor progresses.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-1268652613031354168?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/1268652613031354168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=1268652613031354168&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1268652613031354168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1268652613031354168'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/10/converting-vba-code-to-net.html' title='Converting VBA code to .Net'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-1014162347753842040</id><published>2007-09-13T08:45:00.000-06:00</published><updated>2007-09-13T09:13:38.288-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP classic'/><category scheme='http://www.blogger.com/atom/ns#' term='QueryString'/><title type='text'>Altering QueryString with Javascript</title><content type='html'>I'm making a grid in a legacy ASP application. That's right kids, ASP as in Active Server Pages. Old School stuff. None of the ultra-kewl .NET does it all for you stuff. Which, BTW, I really love because I can do so much more so much faster and better. But, alas, the client says "ASP only!" so, I go with ASP.&lt;br /&gt;&lt;br /&gt;What they wanted to do was display their data in a grid. Yeah, right, ASP and datagrids, that is a rich one. So what I did was something almost, but not quite, completely different from a grid. I put their data in an HTML table with alternating row colors (hey, at least they &lt;span style="font-style: italic;"&gt;think&lt;/span&gt; it's in a grid).&lt;br /&gt;&lt;br /&gt;But of course, in any good datagrid, one must be able to click on the grid headers and VOILA! the grid sorts by the header clicked. This, I figured out, to do with JavaScript via the QueryString. The table is in an IFRAME, so the URL is never displayed to the end user. Doing this keeps the displayed URL fairly nice and neat. My original though, which seemed to work fairly well was just to cut the QueryString off at the desired parameter, and replace that parameter with the new one as such:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:courier new;"&gt;function reSortGrid(str)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; idx = location.href.indexOf(&lt;span style="color: rgb(204, 102, 0);"&gt;'&amp;sortby'&lt;/span&gt;);&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;var &lt;/span&gt;loc = location.href.substring(0, idx);&lt;br /&gt;   loc = loc + '&amp;sortby=' + str;&lt;br /&gt;   location.href = loc;&lt;br /&gt;}&lt;/pre&gt;But then it occurred to me that if any parameters existed beyond the parameter I was replacing, they would be lost. No, what I really needed was to replace the existing sortby parameter within the actual string, while maintaining the rest of the string. This took a little thinking on my part, and what I came up with is:&lt;br /&gt;&lt;pre  style="font-family:courier new;"&gt;function resortGrid(str)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; newQueryString = &lt;span style="color: rgb(204, 102, 0);"&gt;''&lt;/span&gt;;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (location.href.indexOf(&lt;span style="color: rgb(204, 102, 0);"&gt;'&amp;sortby'&lt;/span&gt;) &gt; -1)&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; locArray = &lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; Array();&lt;br /&gt;       locArray = location.href.split(&lt;span style="color: rgb(204, 102, 0);"&gt;'&amp;'&lt;/span&gt;);&lt;br /&gt;       &lt;span style="color: rgb(51, 51, 255);"&gt;for&lt;/span&gt; (i=0; i&lt;locarray.length;&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (locArray[i].indexOf(&lt;span style="color: rgb(204, 102, 0);"&gt;'sortby'&lt;/span&gt;) &gt; -1)&lt;br /&gt;&lt;/locarray.length;&gt;        {&lt;br /&gt;           &lt;locarray.length;&gt;locArray[i] = "sortby=" + str;&lt;br /&gt;&lt;/locarray.length;&gt;            &lt;locarray.length;&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;// check to see if this is the start of the QueryString&lt;/span&gt;&lt;br /&gt;&lt;/locarray.length;&gt;            &lt;locarray.length;&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (locArray[i].indexOf(&lt;span style="color: rgb(204, 102, 0);"&gt;'?'&lt;/span&gt;) == -1)&lt;br /&gt;&lt;/locarray.length;&gt;                &lt;locarray.length;&gt;newQueryString = newQueryString + &lt;span style="color: rgb(204, 102, 0);"&gt;'&amp;'&lt;/span&gt; + locArray[i];&lt;br /&gt;&lt;/locarray.length;&gt;            &lt;locarray.length;&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;/locarray.length;&gt;                &lt;locarray.length;&gt;newQueryString = locArray[i];&lt;br /&gt;&lt;/locarray.length;&gt;        &lt;locarray.length;&gt;}&lt;br /&gt;&lt;/locarray.length;&gt;    &lt;locarray.length;&gt;}&lt;span style="color: rgb(51, 51, 255);"&gt;else&lt;/span&gt;{&lt;br /&gt;&lt;/locarray.length;&gt;        &lt;locarray.length;&gt;newQueryString = location.href + &lt;span style="color: rgb(204, 102, 0);"&gt;'&amp;sortby='&lt;/span&gt; + str;&lt;br /&gt;&lt;/locarray.length;&gt;    &lt;locarray.length;&gt;}&lt;br /&gt;&lt;/locarray.length;&gt;    &lt;locarray.length;&gt;location.href = newQueryString;&lt;br /&gt;}&lt;/locarray.length;&gt;&lt;/pre&gt;So what I ended up with is a QueryString with the correct parameter changed, and the rest of the parameters intact.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-1014162347753842040?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/1014162347753842040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=1014162347753842040&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1014162347753842040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1014162347753842040'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/09/altering-querystring-with-javascript.html' title='Altering QueryString with Javascript'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-8344877256367492945</id><published>2007-08-14T09:03:00.001-06:00</published><updated>2007-08-14T09:03:55.577-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><category scheme='http://www.blogger.com/atom/ns#' term='VBScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP classic'/><title type='text'>Old School</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;This is becoming less of a blog about C# lately, and more of a blog about web programming in general. Hopefully I'll get back to C# sooner, rather than later.&lt;br/&gt;&lt;br/&gt;Currently, my project is to enhance and expand an application written in ASP and...get this...Delphi!!!! And I have to tell you, after using C# and ASP.NET for the past 5 years, ASP SUCKS!! And not just a little, ASP sucks splendidly!&lt;br/&gt;&lt;br/&gt;The current problem I fighting with is accessing an MS Access database via ASP. Getting there the first time isn't too bad, but when I try to get to it a second time, it blows up with that oh so informative error of:&lt;br/&gt;&lt;blockquote&gt;Provider error '80004005' &lt;br/&gt;&lt;br/&gt;Unspecified error &lt;br/&gt;&lt;br/&gt;/Bridge/facilities/facmain.inc, line 13 &lt;/blockquote&gt;&lt;br/&gt;Now, if Microsoft could any more ambiguous, I don't know how. It looks like I'm going to have make a separate DB connection for each RecordSet. This seems stupid and entirely inefficient, but as Duke Wayne said "A man's gotta do what a man's gotta do."&lt;br/&gt;&lt;br/&gt;I am seriously not wanting to delve into that Delphi portion of the project, but that is coming soon enough.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;br/&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/ASP%20Classic' class='performancingtags'&gt;ASP Classic&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Delphi' class='performancingtags'&gt;Delphi&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/VBScript' class='performancingtags'&gt;VBScript&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-8344877256367492945?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/8344877256367492945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=8344877256367492945&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8344877256367492945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8344877256367492945'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/08/old-school.html' title='Old School'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-2520388114100759409</id><published>2007-08-01T15:25:00.000-06:00</published><updated>2007-08-01T15:30:36.674-06:00</updated><title type='text'>Basic blog DB diagram</title><content type='html'>As promised, here is a basic diagram for my blog database. I still need to look at creating user role permissions (like can they post? can the delete comments? etc.). If you have any ideas, please through them my way!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_JJXxSGFQyNU/RrD6qBMNf5I/AAAAAAAAABs/vCLgr1EB8wU/s1600-h/blogdbdiag.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_JJXxSGFQyNU/RrD6qBMNf5I/AAAAAAAAABs/vCLgr1EB8wU/s400/blogdbdiag.png" alt="" id="BLOGGER_PHOTO_ID_5093846778337132434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Anyway, it is a start. I almost forgot to include a configuration table for the blog! This would have been a dire thing indeed without that!&lt;br /&gt;&lt;br /&gt;Anyway, there you have it. If anyone is actually reading this stuff, please let me know what you think (I am no database guy), and offer suggestions!&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-2520388114100759409?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/2520388114100759409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=2520388114100759409&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2520388114100759409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2520388114100759409'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/08/basic-blog-db-diagram.html' title='Basic blog DB diagram'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_JJXxSGFQyNU/RrD6qBMNf5I/AAAAAAAAABs/vCLgr1EB8wU/s72-c/blogdbdiag.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-3715289874080046971</id><published>2007-08-01T10:32:00.000-06:00</published><updated>2007-08-01T11:50:48.840-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Templates'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Themes'/><title type='text'>Loading themes programmatically</title><content type='html'>I've made a little progress on the database diagram, but admittedly, that is not the most fun aspect of life. So I have been concentrating a little more the past couple of days on the front-end. I have been playing with themes, skins and styles.&lt;br /&gt;&lt;br /&gt;One thing I wanted to be able to do was change the theme programmatically. I know this should be possible, but dog-gone if it wasn't a pain in the arse to figure out! After oodles of Google searches, I finally found &lt;a href="http://aspalliance.com/959"&gt;this article at ASP Alliance&lt;/a&gt;. Good detail and explains a lot.&lt;br /&gt;&lt;br /&gt;In a nutshell, the best way to programmatically change themes is to create a base class. I named mine &lt;span style="font-family:courier new;"&gt;BasePage.cs&lt;/span&gt;. This class inherits &lt;span style="font-family:courier new;"&gt;System.Web.UI.Page&lt;/span&gt;. Other pages (not the .master pages though) inherit this &lt;span style="font-family:courier new;"&gt;BasePage&lt;/span&gt; instead of &lt;span style="font-family:courier new;"&gt;System.Web.UI.Page&lt;/span&gt;. Wait, I think I'm getting a little ahead of myself. Let me back up a little.&lt;br /&gt;&lt;br /&gt;One can programmatically set the page theme &lt;span style="color: rgb(51, 51, 255);"&gt;(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Page.Theme&lt;/span&gt;), but only in the &lt;span style="font-family:courier new;"&gt;Page_PreInit(&lt;span style="color: rgb(51, 51, 255);"&gt;object &lt;/span&gt;sender,&lt;span style="color: rgb(51, 51, 255);"&gt;System.EventArgs&lt;/span&gt; e)&lt;/span&gt; method. However, this method is not valid in any .master file. Therefore, this method must be set in the actual .aspx files. There are two ways to do this, put the &lt;span style="font-family:courier new;"&gt;Page_PreInit&lt;/span&gt; method in each and every page file. This can cause issues if one wants to change the way they programmatically load themes (i.e., via cookies, session, use-select etc). The better way is to create a separate class which inherits from &lt;span style="font-family:courier new;"&gt;System.Web.UI.Page,&lt;/span&gt; and which all other .aspx classes inherit (instead of the &lt;span style="font-family:courier new;"&gt;System.Web.UI.Page&lt;/span&gt; class).&lt;br /&gt;&lt;br /&gt;Okay, now that I have that out of the way, back to the meat. In the &lt;span style="font-family:courier new;"&gt;BasePage&lt;/span&gt; class I added a &lt;span style="font-family:courier new;"&gt;Page_PreInit&lt;/span&gt; method. In this method is where I set the theme.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;void&lt;/span&gt; Page_PreInit(&lt;span style="color: rgb(51, 51, 255);"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(51, 51, 255);"&gt;System.EventArgs&lt;/span&gt; e)&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;] != &lt;span style="color: rgb(51, 51, 255);"&gt;null&lt;/span&gt; &amp;&amp;amp; Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;].ToString().Length &gt; 0)&lt;br /&gt;          &lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Page.Theme = Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;].ToString();&lt;br /&gt;      &lt;span style="color: rgb(51, 51, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Page.Theme = &lt;span style="color: rgb(153, 51, 0);"&gt;"Default"&lt;/span&gt;;&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For testing, I created three themes, Default, LeftSidebar and RightSidebar. In the .master file I created a table with a 'header' row which contains only 1 column, a 'body' row which contains three columns and a 'footer' row which contains only 1 column. I assigned classes to each of the columns. In the stylesheet in the theme folders I defined how the table should appear. For instance, for easy identification in the Default theme's stylesheet, I put the header column background to aqua, the footer to lime the left side bar to read the main body to white and the right side bar to blue. This way, it is very easy to see what is displaying proper and what isn't.&lt;br /&gt;&lt;br /&gt;For the LeftSidebar and RightSidebar themes' stylesheet, I simply made the column width 0px and the background color transparent (for which ever column was going to &lt;span style="font-style: italic;"&gt;not &lt;/span&gt;be seen).&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;.&lt;span style="color: rgb(153, 51, 0);"&gt;leftSideBar&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    width&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;15%&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    background-color&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;Red&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    vertical-align&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;top&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;.&lt;span style="color: rgb(153, 51, 0);"&gt;rightSideBar&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    width&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;0px&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    background-color&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;Transparent&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    vertical-align&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;top&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Am I making any sense here? Sometimes I think I start rambling, and then I don't very well explain myself. Anyway...&lt;br /&gt;&lt;br /&gt;To select which theme to load, I placed a DropDownList in the header section of the table. The list contains four items "Select Theme","Default","Left Side Bar Theme" and "Right Side Bar Theme". Then I added an &lt;span style="font-family:courier new;"&gt;SelectedIndexChanged&lt;/span&gt; event handler and set a Session variable to the selected value of the DropDownList control.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;protected void&lt;/span&gt; DropDownList1_SelectedIndexChanged(&lt;span style="color: rgb(51, 51, 255);"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(51, 51, 255);"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt; if (this.DropDownList1.SelectedIndex &gt; 0)&lt;br /&gt; {&lt;br /&gt;     Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;] = &lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.DropDownList1.SelectedItem.Value;&lt;br /&gt;     Response.Redirect(Request.Url.AbsoluteUri);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Basically, this will cause two postbacks. The first when the DropDownList control selection is changed, and the second after the &lt;span style="font-family:courier new;"&gt;Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;] &lt;/span&gt;value is set. It is neccessary to do another post back at this time because, in the hierarchy of how things happen in ASP.NET, the &lt;span style="font-family:courier new;"&gt;Page_PreInit&lt;/span&gt; method happens before the &lt;span style="font-family:courier new;"&gt;Page_PostBack&lt;/span&gt; and anything that follows that. Since the &lt;span style="font-family:courier new;"&gt;Session&lt;/span&gt; variable is not set until after the &lt;span style="font-family:courier new;"&gt;Page_PreInit&lt;/span&gt; is executed, it is necessary to post back again after setting the &lt;span style="font-family:courier new;"&gt;Session[&lt;span style="color: rgb(153, 51, 0);"&gt;"Theme"&lt;/span&gt;]&lt;/span&gt; variable.&lt;br /&gt;&lt;br /&gt;This will programmatically change the themes based on what the user selects. Other ways of loading themes I will be investigating are via cookies, and database entries.&lt;br /&gt;&lt;br /&gt;Thanks for stopping by, you can wake up now!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-3715289874080046971?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/3715289874080046971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=3715289874080046971&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/3715289874080046971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/3715289874080046971'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/08/ive-made-little-progress-on-database.html' title='Loading themes programmatically'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-2665469005813059856</id><published>2007-07-31T10:58:00.000-06:00</published><updated>2007-07-31T11:01:15.039-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Templates'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Skins'/><category scheme='http://www.blogger.com/atom/ns#' term='Themes'/><title type='text'>Templates and themes and skins...OH MY</title><content type='html'>&lt;span style="font-weight: bold; font-style: italic;font-family:verdana;font-size:130%;"  &gt;Templates, templates, templates!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the great new features of ASP.NET in the 2.x/3.x framework are templates. Short story, templates are just what they imply, the create a basic framework for you ASP.NET application, into which you stick your content.&lt;br /&gt;&lt;br /&gt;We all like sites that are intuitive and easy to navigate. Before now, the way we achieved this was either through frames, user controls and/or simply copying code to all the pages. This would get the breadcrumb trail and the left margin links and the header an all that great stuff. The most efficient, IMO were user controls. You create a control, and stick it on each page, then if you needed a change, you just change the control, not having to bother with the other pages.&lt;br /&gt;&lt;br /&gt;Templates work in much the same way, but they go beyond that. With ASP.NET 2.x you can apply themes and skins to your site by simply identifying which one to use. You can have blue skins, and red skins and purple skins. And you can allow the visitor to select which skin they like best, and load that one for them.&lt;br /&gt;&lt;br /&gt;Themes are a little more in depth. Anyone familiar with blogger or wordpress or other blogging formats will understand the themes idea. A theme defines the layout and module content of the page. What I am referring to as module content in this case are the little applet type things one finds on pages. Like the aforementioned breadcrumb trail, the header, the footer the sidebars, the ad space, the blog rolls or other links. Basically, everything that is not your main content, that you want viewable on every page.&lt;br /&gt;&lt;br /&gt;There are a plethora (gosh I love that word - plethora - it just kind of rolls of the tongue, doesn't it?) of pages out there with information on how to use templates, and with some digging, one can find instructions on how to make templates. Please note, templates,skins and themes make extensive use of CSS. If you don't understand CSS, it would be a really good idea to learn more about that first, because it will only frustrate you in the end!&lt;br /&gt;&lt;br /&gt;One of the best sources I have found for theme information and instruction is &lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/masterpages/default.aspx" target="_blank"&gt;Microsoft's ASP.NET Quickstart Tutorials&lt;/a&gt;. This is setup so, if you know the basics, and are familiar with ASP.NET 1.1, you can jump right into what you are looking for.&lt;br /&gt;&lt;br /&gt;If creating your own template seems to daunting a task, you can download several templates from the &lt;a href="http://msdn2.microsoft.com/en-us/asp.net/Aa336613.aspx" target="_blank"&gt;MSDN site&lt;/a&gt;, then customize as you see fit! The templates are available in both VB and C# source, so which ever you use, you can use these templates.&lt;br /&gt;&lt;br /&gt;Over the next few weeks (hopefully not that long, but you never know). I'm going to create a template from scratch (hopefully it will be visually appealing, but again, you never know), and use this site to document my efforts. The template I am going to create will be for a blog. I have been (as stated in other posts I think) lamentful that there is really good, easily usable and easily findable blog software written in ASP.NET (especially C#). So I am going to create blog software to do that. First, I must create the database though, and for that I am going to borrow heavily from the mySQL database used for WordPress blogs. That database has pretty much everything I can think to need, but there are something I think I would do differently, so I'm going to use the schema as base point to start from. The database will be created using Microsoft SQL Server 2005.&lt;br /&gt;&lt;br /&gt;Hopefully, but the end of the week, I'll have a database diagram that I can post here and (if anyone is actually reading this) can get some feedback on.&lt;br /&gt;&lt;br /&gt;Until then, take care, and thanks for visiting! (seriously, you can leave comments and everything!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-2665469005813059856?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/2665469005813059856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=2665469005813059856&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2665469005813059856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2665469005813059856'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/07/templates-and-themes-and-skinsoh-my.html' title='Templates and themes and skins...OH MY'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-4436916341894382117</id><published>2007-07-11T08:22:00.001-06:00</published><updated>2007-07-11T08:22:14.270-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Functional Specs'/><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><title type='text'>Spex</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Something that we didn't really do at my previous job was functional&lt;br /&gt;specifications for projects or applications. Well, that is not entirely&lt;br /&gt;accurate. What I should say is that we didn't do these &lt;span style='font-style: italic;'&gt;before &lt;/span&gt;we started coding the application, but once it was all done and complete, &lt;span style='font-style: italic;'&gt;then &lt;/span&gt;we would write out the specs. Amazing how all of our code matched perfectly to the specs and design docs.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;This puts me at somewhat of a disadvantage as now I am supposed to&lt;br /&gt;write up a functional spec for a project. Up pops the trusty ol' Google&lt;br /&gt;search engine. This is what I have found regarding functional&lt;br /&gt;specifications for software. There is a whole lot of stuff out there,&lt;br /&gt;but it is very difficult to find the one that really describes things&lt;br /&gt;in a way that 1) is understandable by me and b) somewhat almost fits&lt;br /&gt;the type of project I'm working on.&lt;br/&gt;&lt;br/&gt;So far, one of the ones I like the best is the PDF doc "&lt;a href='http://www.techtransform.com/process/PMTech/FUNCTEMP.pdf'&gt;Template for Functional Specifications&lt;/a&gt;".&lt;br/&gt;&lt;br/&gt;A rather humorous template can be found a &lt;a href='http://www.joelonsoftware.com/articles/WhatTimeIsIt.html'&gt;Joel on Software&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;A rather nice essay titled "&lt;a href='http://www.techwr-l.com/techwhirl/magazine/writing/softwarerequirementspecs.html'&gt;Writing Software Requirements Specifications&lt;/a&gt;" by Donn LeVie, Jr is informative, but not really much of a sample. I'm much better with looking at how something is put together, then altering it to fit my needs, than I am at reading on how to do it from scratch.&lt;br/&gt;&lt;br/&gt;Another template in PDF format is the "&lt;a href='http://www.stcsig.org/mgt/docs/uncspectempl.pdf'&gt;Software Functional Specification Template&lt;/a&gt;". It is sometimes interesting to see the different methods and styles used to write basically the same information.&lt;br/&gt;&lt;br/&gt;Well, I hope these resources help you out some if you need to look at doing a functional spec. If not, well at least it was a short post, and you didn't waste too much time on it!&lt;br/&gt;&lt;br/&gt;Have Fun!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;small&gt;Technorati Tags: &lt;a rel='tag' href='http://technorati.com/tag/ASP.NET' class='performancingtags'&gt;ASP.NET&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Fucntional%20Specifications' class='performancingtags'&gt;Fucntional Specifications&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Software' class='performancingtags'&gt;Software&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Functional%20Specs' class='performancingtags'&gt;Functional Specs&lt;/a&gt;, &lt;a rel='tag' href='http://technorati.com/tag/Design' class='performancingtags'&gt;Design&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-4436916341894382117?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/4436916341894382117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=4436916341894382117&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4436916341894382117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4436916341894382117'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/07/spex.html' title='Spex'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-8966879221299827354</id><published>2007-06-21T07:33:00.000-06:00</published><updated>2007-06-21T07:36:20.787-06:00</updated><title type='text'>New Directions</title><content type='html'>Okay, so I have changed jobs. Where I was working I was doing C# desktop development. Now, I am doing C# ASP.NET development. This is quite a change. I have not done any web development for about four years. I have quite a bit of catching up to do.&lt;br /&gt;&lt;br /&gt;I am working with a mental picture of web development that is four years old. In internet years, that is something like 75.6 years old to you and me. So I will probably be posting here a lot more as I run across what I think are new and exciting things in the world of C# ASP.NET development.&lt;br /&gt;&lt;br /&gt;Stay tuned, and hang on. It looks like it is going to be a bumpy ride!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-8966879221299827354?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/8966879221299827354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=8966879221299827354&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8966879221299827354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8966879221299827354'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/06/new-directions.html' title='New Directions'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-6164829128889884064</id><published>2007-02-22T10:49:00.000-06:00</published><updated>2007-02-22T11:04:15.412-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BackColor'/><category scheme='http://www.blogger.com/atom/ns#' term='System.Windows.Forms.Label'/><category scheme='http://www.blogger.com/atom/ns#' term='ForeColor'/><category scheme='http://www.blogger.com/atom/ns#' term='BorderStyle'/><title type='text'>Resolving strange label behavior</title><content type='html'>I ran into a problem recently where I have something very much like map in my Windows Desktop application.  The map-type thingy is bound to a dataset.  The app draws items in a picture box based on the data in the dataset.  What I needed was a label that would display information when the user moved the mouse over one of the items drawn on the form (like a tool tip).&lt;br /&gt;&lt;br /&gt;Naturally, I used a dynamically created &lt;span style="font-family: courier new;"&gt;System.Windows.Forms.Label&lt;/span&gt; object.  The user has the ability to determine what is displayed in the mouse over label.  They could go to a settings form and set to display static text, values from data columns, or a combination of static text and column values (i.e. ID=234 - ID being static, 243 being the value from the dataset).&lt;br /&gt;&lt;br /&gt;The problem I ran into was that the label generated and displayed properly when a data value was declared, but would only display the label border when only static text was to be displayed.  The label has a border of &lt;span style="font-family: courier new;"&gt;BorderStyle.FixedSingle&lt;/span&gt; and the &lt;span style="font-family: courier new;"&gt;BackColor&lt;/span&gt; of &lt;span style="font-family: courier new;"&gt;Color.FromARGB(255,255,225)&lt;/span&gt; - this is the color of the standard ToolTip in Windows.  but what was being displayed was just the outline of the label.  No &lt;span style="font-family: courier new;"&gt;BackColor&lt;/span&gt;, no text.  The label color would be whatever color was under where the label was supposed to be.&lt;br /&gt;&lt;br /&gt;On a last ditch effort, I set the &lt;span style="font-family: courier new;"&gt;Label.Font&lt;/span&gt; property to &lt;span style="font-family: courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Font&lt;/span&gt;.  That fixed the problem.  I don't know why it fixed the problem.  I don't know what happened to the default font for the label, nor why the label &lt;span style="font-family: courier new;"&gt;BackColor&lt;/span&gt; was displaying as either &lt;span style="font-family: courier new;"&gt;Color.Transparent&lt;/span&gt;, or &lt;span style="font-family: courier new;"&gt;Color.Empty&lt;/span&gt; or whatever it was doing.  But I do know that this fixed the problem.&lt;br /&gt;&lt;br /&gt;I hope this helps someone out there.&lt;br /&gt;&lt;br /&gt;Thanks for visiting!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-6164829128889884064?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/6164829128889884064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=6164829128889884064&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6164829128889884064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/6164829128889884064'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/02/resolving-strange-label-behavior.html' title='Resolving strange label behavior'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-1252263499187256758</id><published>2007-01-06T11:03:00.000-06:00</published><updated>2007-01-06T11:16:16.912-06:00</updated><title type='text'>A new direction</title><content type='html'>Ok, while at work I'm still kinda-sorta working with the Enterprise Library, that has - for a while anyway - been put on hold while I tossed onto a product to be delivered in January 07. This is something I haven't worked on, and must now get caught up in what it is and what it does, so the EntLib has to be put on hold.&lt;br /&gt;&lt;br /&gt;On another note.  I have  a couple of other blogs, most hosted by places like this (&lt;a href="http://www.blogger.com"&gt;blogger.com&lt;/a&gt;).  One is hosted on my own.  I mean, I host it on space I rent - it's not like I actually have access to the server guts or anything.  For that blog (&lt;a href="http://www.bigsibling.com"&gt;http://www.bigsibling.com&lt;/a&gt;), I have been using &lt;a href="http://www.dotnetnuke.com/"&gt;DotNetNuke&lt;/a&gt;.  DNN is a great portal application.  I use it several other places as well.  And for what it is designed for, it does an exceptional job, and I wouldn't really want to use anything else for a portal application.&lt;br /&gt;&lt;br /&gt;But (there is always a but - isn't there), for the blog I am using a &lt;a href="http://www.dotnetnuke.com/DotNetNukeProjects/ModuleBlog/tabid/842/Default.aspx"&gt;blog module&lt;/a&gt; for DNN.  While this works for the most part.  Posting to it is a bit slow, and something just don't work as smoothly as I would imagine they should.  I want to emphatically state that the product is a great and feature rich product.  I have no real complaints about DNN or the blog plugin for DNN.  The only thing is, the whole thing is a little bloated because it was not designed to be a blog application, but a porta application.  So DNN has oodles of ultra-kewl features that I don't use on the blog itself. &lt;br /&gt;&lt;br /&gt;With that in mind, I'm toying with the idear of creating a blog web appliction in .NET.  I know, I know, there is dasBlog and probably some others.  But hey, how can I learn new and exciting stuff if all I do is use other peoples stuff?  Also, how can you laugh at all of my stupid mistakes if I don't jump into adventures like this?  I mean, seriously, how can I provide your needed comic releif in any other way?&lt;br /&gt;&lt;br /&gt;In preliminary research I did find this fairly (I think) &lt;a href="http://www.ojr.org/ojr/stories/050714gardner/"&gt;comprehensive list&lt;/a&gt; of what a good blog application should have.&lt;br /&gt;&lt;br /&gt;Anyway, this is what I'm thinking of.  If you care, let me know if you think it is a worthy endeavour, or if you think I'm nutz.&lt;br /&gt;&lt;br /&gt;Thanks for visiting!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-1252263499187256758?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/1252263499187256758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=1252263499187256758&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1252263499187256758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/1252263499187256758'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2007/01/new-direction.html' title='A new direction'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-2551844709147920338</id><published>2006-12-21T10:25:00.000-06:00</published><updated>2006-12-21T10:29:06.423-06:00</updated><title type='text'>EntLib starting to come around</title><content type='html'>We are focusing on three blocks in the Enterprise Library; Logging, Configuration and Exception Handling.  I'm looking at Logging first because everthing else will touch on the logging.  What we need is to force three attributes into each log.  These three are already provided in by the LogEntry object, these are; Application Name, Application Version and Event ID.  Okay, so application version is not supplied by the LogEntry, but we can get that easy enough.&lt;br /&gt;&lt;br /&gt;The other thing we want is that the custom logger or tracelistener or whatever it is we create must be inherited and cannot be instantiated on its own.  While this sounds easy enough via an abstract class, it turned out not to be so practical.  It seems that, while I can create an abstract class that inherits the ILogFormatter, that class can't be used in the Enterprise Library Configuration tool.&lt;br /&gt;&lt;br /&gt;Hmmmm...I wonder if we can extend the Enterprise Library Configuration tool to force the required attributes and formatters.  Now I have something else to look at.&lt;br /&gt;&lt;br /&gt;I've been able to find some information on using Enterprise Library.  One place which has links to tutorials (or at least is supposed to) is Channel9 Wiki.  However, most the tutorials that would actually do me any good are by that Hisham Baz fellow, and I can't seem to get to his site from work.  I'll have to try from home, perhaps it is just that exceptionally poor quality of internet service we experience here:&lt;br /&gt;&lt;br /&gt;&lt;a target="_blank" href="http://channel9.msdn.com/wiki/default.aspx/Channel9.EnterpriseLibraryTutorials"&gt;Channel9 Wiki&lt;/a&gt;&lt;br /&gt;&lt;a target="_blank" href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=295a464a-6072-4e25-94e2-91be63527327"&gt;EnterpriseLibrary Home&lt;/a&gt;&lt;br /&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/practices/comm/entlibblogs/default.aspx"&gt;EnterpriseLibrary MSDN blogs&lt;/a&gt;&lt;br /&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/entlib2.asp"&gt;MSDN EnterpriseLibrary page&lt;/a&gt;&lt;br /&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8CA14D0-05EA-4A44-AE78-F5E4DF6208AF&amp;amp;displaylang=en"&gt;Hands on Labs - EnterpriseLibrary 2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-2551844709147920338?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/2551844709147920338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=2551844709147920338&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2551844709147920338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/2551844709147920338'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/entlib-starting-to-come-around.html' title='EntLib starting to come around'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-868361281649356017</id><published>2006-12-15T11:48:00.000-06:00</published><updated>2006-12-15T11:51:06.537-06:00</updated><title type='text'>Oh the confustion is causes!</title><content type='html'>Trying to find information on how to use the Enterprise Library is like looking for information on how to use the Enterprise Library!  This is worse than needle in a haystack scenario.  I see lots of how EntLib works, and why it works, but very little on practical applications of EntLib.  I should probably look at the documentation that came with the EntLib download.  I haven't yet - but mostly because Microsoft has a history of piss-poor documentation (when there is any at all).&lt;br /&gt;&lt;br /&gt;More soon!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-868361281649356017?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/868361281649356017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=868361281649356017&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/868361281649356017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/868361281649356017'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/oh-confustion-is-causes.html' title='Oh the confustion is causes!'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-4158801434712665295</id><published>2006-12-07T15:03:00.000-06:00</published><updated>2006-12-07T15:07:18.935-06:00</updated><title type='text'>Enterprise Library</title><content type='html'>We're going to start using &lt;a href="http://msdn.microsoft.com/library/?url=/library/en-us/dnpag2/html/EntLib2.asp"&gt;Enterprise Library for .NET Framework 2.0&lt;/a&gt; to handle our configuration, exception handling, and logging processes.  This is going to be fairly new because we've never been ones to actually follow recommended practices on most of anything.  Maybe we'll end up with some readable code that actually works. :)&lt;br /&gt;&lt;br /&gt;Anyway, I'll be posting in the near future the experience about a first time user with this library and it's implications.&lt;br /&gt;&lt;br /&gt;Thanks for visiting!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-4158801434712665295?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/4158801434712665295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=4158801434712665295&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4158801434712665295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/4158801434712665295'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/enterprise-library.html' title='Enterprise Library'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-8423498905831637344</id><published>2006-12-01T19:51:00.000-06:00</published><updated>2006-12-01T19:52:17.518-06:00</updated><title type='text'>Other places of interest</title><content type='html'>I have several other blogs, they are updated as my schedule permits, but at least a couple of times a week.&amp;nbsp; You can get there via the following links:&lt;br&gt;&lt;br&gt;&lt;a href="http://myownhomeown.blogspot.com"&gt;My Home Town&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.bigsbling.com"&gt;Bigsibling&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.blogcharm.com/bigsibling"&gt;At The Top Of My Lungs&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.blogcharm.com/csharpfollies"&gt;C# Follies&lt;/a&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-8423498905831637344?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/8423498905831637344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=8423498905831637344&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8423498905831637344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8423498905831637344'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/other-places-of-interest.html' title='Other places of interest'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-5569415517044345398</id><published>2006-12-01T10:56:00.000-06:00</published><updated>2006-12-15T11:30:03.148-06:00</updated><title type='text'>Using CACLS in an MSI install</title><content type='html'>What I have discovered is that if you use the Setup and Deployment project from the Visual Studio 2003 IDE, it doesn't always work the way one might expect it to work.&lt;br /&gt;&lt;br /&gt;For instance, when the user installs the program, they are presented with the option to select to install the program for them only, or for anyone on that machine.  If the user selects for them only, it would be expected that the files and components of that program's permissions are set so as to only allow that person to run the program.&lt;br /&gt;&lt;br /&gt;However, if the user selects to allow all users to run the program, my prevailing expectation was that it would set permissions on the files and components to allow any user to run the program.  WRONG.  As I should have expected, with Microsoft making so many assumptions and decisions for us (and giving us very little means to adjust that easily), the files and components are set to read only for all but admin account holders.&lt;br /&gt;&lt;br /&gt;In our programs, there are many files that are read and written to.  For this, since we have dropped InstallShield as our primary install creating agent, I had to create yet another small program that runs on install (that makes two now).  I do have these installed as "hidden" files so hopefully it won't clutter up the install directory too badly.&lt;br /&gt;&lt;br /&gt;At any rate, I use CACLS.EXE to set the directory permissions.  It's a fairly simple command line program.  As I didn't want to pop open an command line window, I created a form that is 1px by 1px, located at 0,0 and has an opacity of 0.  This should keep it from being seen at all.  What we needed was for the local "Users" group to have read/change permissions to all files that get installed.  For that I used the command line switch "/G BUILTIN\Users:C(hange)".  This table lists the permission codes:&lt;div align="center"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;N&lt;/td&gt;&lt;br /&gt;&lt;td&gt;None&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;R&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Read&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;W&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Write&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;C&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Change&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;F&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Full&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;The codes really are (surprisingly) intuitive.  There are other switches involved.  These are&lt;br /&gt;&lt;div align="center"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/T&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Recursive through current and all sub-directories&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/E&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Edits permissions (doesn't replace them)&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/C&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Ignores "Access Denied" errors&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/G&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Grant access rights&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/R&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Revoke access rights&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/P&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Replace access rights&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;/D&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Deny access rights&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So I end up with the following example:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; response;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; userPerm = @"BUILTIN\Users:C";&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; fileDirectory = @"C:\Program Files\Program";&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; caclsSwitches = @" /T /E /C /G ";&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; caclsLoc = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "CACLS.EXE");&lt;br /&gt;Process p;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Directory.Exists(fileDirectory)&lt;br /&gt;{&lt;br /&gt; p = new Process();&lt;br /&gt; p.StartInfo.FileName = calsLoc;&lt;br /&gt; p.StartInfo.Arguments = fileDirectory + caclsSwitches + userPerm;&lt;br /&gt; p.StartInfo.RedirectStandardOutput = true;&lt;br /&gt; p.StartInfo.UseShellExecute = false;&lt;br /&gt; p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;&lt;br /&gt; p.StartInfo.CreateNoWindow = true;&lt;br /&gt; p.Start();&lt;br /&gt; response = p.StandardOutput.ReadToEnd();&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; if&lt;/span&gt; (response == &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt; || response.Lenghth == 0)&lt;br /&gt; {&lt;br /&gt;  &lt;span style="color: rgb(0, 255, 0);"&gt;// handle errors here&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; if&lt;/span&gt; (p != null) p.Dispose();&lt;br /&gt; response = &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Resources:&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/162786" target="_blank"&gt;Undocumented CACLS: Group Permissions Capabilities&lt;/a&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/135268" target="_blank"&gt;How to Use CACLS.EXE in a Batch File&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.computerhope.com/cacls.htm" target="_blank"&gt;Information about the cacls command.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-5569415517044345398?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/5569415517044345398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=5569415517044345398&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5569415517044345398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/5569415517044345398'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/what-i-have-discovered-is-that-if-you.html' title='Using CACLS in an MSI install'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-8508413594449694839</id><published>2006-12-01T10:01:00.000-06:00</published><updated>2006-12-01T10:02:01.430-06:00</updated><title type='text'>Technorati</title><content type='html'>I found this site where blogs are listed and indexed and thought I'd sign up.&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://www.technorati.com/claim/cqwtuthqz" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-8508413594449694839?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/8508413594449694839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=8508413594449694839&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8508413594449694839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/8508413594449694839'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/12/technorati.html' title='Technorati'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-3532289500916602065</id><published>2006-10-06T10:05:00.000-06:00</published><updated>2006-10-26T11:43:28.209-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET Add-In'/><title type='text'>Creating an Add-In for VS.NET 2003</title><content type='html'>&lt;h3&gt;&lt;span style="color:#0000ff;"&gt;Eh, nevermind (25 October, 2006)&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;So, as Mathieu so kindly pointed out in the comments section, PushOK does a VS.NET 2003 add-in for CVS rather inexpensively.  While I was looking forward to actually creating an add-in for VS.NET, the time I have to play with it just doesn't exist, so I'm scrapping this one.  I may play with it some in VS.NET 2005 at home (I don't have 2003 installed at home anymore), so this might actually go somewhere, but who knows where and when.&lt;/p&gt;&lt;h3&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt; &lt;/h3&gt;&lt;h3&gt;&lt;span style="color:#0000ff;"&gt;Starting Out (06 October, 2006)&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;My company is switching is source control from the woefully in adequate Visual SourceSafe to CVS. I don't know why they refuse to go to Microsoft Team Server, but I suspect that it has a great deal to do with CVS being free, and TeamServer being expen$ive.&lt;br /&gt;&lt;br /&gt;Specifically, we are instructed to use the &lt;a href="http://www.wincvs.org/"&gt;WinCVS&lt;/a&gt; client to access the source code in CVS. After plenty of reading, I realized there is currently no way to access WinCVS through the VS.NET IDE like there is for VSS. I have never created an Add-In for VS before, and thought it sounded somewhat interesting task to tackle. I know it is possible to create one because I see them for sale online for anywhere from $10 to over $200.&lt;br /&gt;&lt;br /&gt;I did some queries on &lt;a href="http://www.live.com/?searchonly=true"&gt;Windows Live&lt;/a&gt; search looking for add-in information. I got a lot of places selling add-ins, but nothing in the way of how to create one. Then I got the bright idea thinking that if any place would have information on creating an add-in for VS, it would be &lt;a href="http://www.ftponline.com/vsm"&gt;VisualStudio Managzine&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-3532289500916602065?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/3532289500916602065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=3532289500916602065&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/3532289500916602065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/3532289500916602065'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/10/creating-add-in-for-vsnet-2003.html' title='Creating an Add-In for VS.NET 2003'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-115955281361553414</id><published>2006-09-29T11:51:00.000-06:00</published><updated>2006-09-29T13:09:53.776-06:00</updated><title type='text'>Crystal Reports in VS 2003 IDE</title><content type='html'>&lt;h3&gt;&lt;span style="color:#0000ff;"&gt;Fixing Data Issues in Crystal Reports&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;I was tasked with making alterations to a set of Crystal Reoprts created by an off-shore company. I had never used Crystal Reports, either in VS.NET or anywhere else.&lt;/p&gt;&lt;p&gt;The first task was to change the length of a data field. I made the appropriate alterations to the data table, changing the allowable number of characters from 15 to 50. This worked just as expected in the C# application. But it was not working in the Crystal Reports report. The generated report still only showed a max of 15 characters.&lt;/p&gt;&lt;p&gt;So I fired up the IDE and opened up the proper .RPT file. Looking at this thing was like something there are no words to describe. I loathed working in it. I haven't yet been able to find a way into the guts of the report, to edit things manually, sans the GUI. I don't believe there is a way to do this. It's all done through the GUI, which, in my book, is a huge minus. The whole reason I never ever bought a Mac was because there was no command line interface. Okay, I know that now there is a command line in the Mac OS, but too little too late.&lt;/p&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/5679/3903/1600/cr_field_menu.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/5679/3903/320/cr_field_menu.jpg" border="0" /&gt;&lt;/a&gt;Back to the problem at hand. I found the field in question in the report, right clicked it and was presenting with a menu I didn't fully understand. But hey, it says Format..., that's go to be where to change the field length. WRONG. The only thing format does is format the text, you know, font, color, weight, size, position, all that jazz.&lt;/p&gt;&lt;p&gt;I hit "Browse Field Data..." not really knowing what would happen. I sent me into a wizard to determine which database to use, I selected the proper database, but it showed only 15 of the 50 characters I had in the database for that field. Strike Two.&lt;/p&gt;&lt;p&gt;Select Expert... did nothing for me. It sent me into another wizard interface that didn't have anything to do with field size. And, still, after two days of messing with this thing, I don't know what an expert is.&lt;a href="http://photos1.blogger.com/blogger/5679/3903/1600/cr_field_explorer_menu.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/5679/3903/320/cr_field_explorer_menu.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/5679/3903/1600/cr_field_explorer_menu.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;To the left of the main window, Crystal Reports has a "Field Explorer" which is kind of like the Server Explorer VS has. Right clicking on the database brings up a different context menu. Oooh, what's this? I see there is an item named "Verify Database". This should fix it. I hit that sucker and the thing starts moving, things are happening, I know this because I'm getting tons of dialog boxes talking about what is being updated.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/5679/3903/1600/cr_50_char.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/5679/3903/320/cr_50_char.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/5679/3903/1600/cr_50_char.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;After it finally finishes, I right click on the report field again, and do the "Browse Field Data..." to see if anything has changed. VOILA! It displays the whole 50 characters. Excellent. That was easy! Rebuild the application and run the report. Doesn't work. I am now getting the error:"Error in formula. 'TableName.FieldName' This field name is not known."While I know good and well that field is in that table which is in the database.&lt;/p&gt;&lt;p&gt;Next thing to try was to re-create the report. I copy the report to another file, and remove the data connection and re-connect. But this method ended up giving me 26 prompts for data. After entering the proper data in all 26 prompts, the reports generated properly. However, the user should not have to enter the same piece of data 26 times in order to see the report. Espcially since the probability of the user knowing the correct data to enter is very, very slim.&lt;br /&gt;Finally, I clicked enough menu items to obtain a solution. I selected the Database Expert, the Set Location option and created a new connection, selected the proper database. Finally after 2 1/2 days of messing around with all of this, it worked, and I was able to put this horrid experience behind me.&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/35134354-115955281361553414?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/115955281361553414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=115955281361553414&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115955281361553414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115955281361553414'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/09/crystal-reports-in-vs-2003-ide.html' title='Crystal Reports in VS 2003 IDE'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-115939012683696492</id><published>2006-09-27T14:41:00.002-06:00</published><updated>2008-05-15T09:09:38.667-06:00</updated><title type='text'>Getting Disk Information in C#</title><content type='html'>&lt;h3&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Using &lt;span style="font-family:Courier New,Courier,Monospace;"&gt;System.Management&lt;/span&gt; and &lt;span style="font-family:Courier New,Courier,Monospace;"&gt;Win32_LogicalDisk&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;In my last post, I briefly spoke about finding drive information in a C# application. The problem I've been trying to solve is that I have a windows form that needs to run at the end of an install. The form allows the user to copy files from a specific location on the install DVD to the users machine. The files are about 1.3Gb, and I didn't really want to package all that data into one MSI file. A problem arose when the install was finished, and the little windows application was copied to the user's machine, how can I find the DVD drive? And after I found a DVD drive, how can I make certain it is the correct drive with the correct disk?&lt;br /&gt;&lt;br /&gt;I started out by importing the kernel32.dll and using the external GetDriveType(string drive). This worked, but I was really wanting to find a C# way to do this without having to import anything else. Enter &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemmanagement.asp"&gt;System.Management&lt;/a&gt; - which allows a user to get all of this information natively in C# using &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_logicaldisk.asp?frame=true"&gt;Win32_LogicalDisk&lt;/a&gt;. Win32_LogicalDisk give you access to a plethora of information on all physical and mapped network drives. You can get the drive name, device id, volume name, serial number and on and on. In addition, you can run SQL type queries against the drive to get just the desired information from the desired drives or drive types or drive sizes and so forth.&lt;br /&gt;&lt;br /&gt;Since I am interested in finding CD/DVD drives, I had to find how to tell what kind of drive I was looking at. The following (from the above linked MSDN page) table was a great help:&lt;br /&gt;&lt;table align="center" border="2" cellpadding="1" cellspacing="1" width="187"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;&lt;td align="center"&gt;&lt;b&gt;Value&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;0&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Unknown&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;1&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;No Root Directory&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;2&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Removeable Disk&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;3&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Local Disk&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;4&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Network Drive&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;5&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Compact Disc&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;6&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;RAM Disk&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Using System.Management.ManagementObjectCollection and System.Management.ManagementObjectSearcher I was able to create a collection of all drives with a device type of 5.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;ManagementScope ms = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;ManagementScope();&lt;br /&gt;ObjectQuery oq  = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;ObjectQuery("SELECT DeviceID, VolumeName FROM Win32_LogicalDisk WHERE DriveType= 5");&lt;br /&gt;ManagementObjectSearcher mos = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;ManagementObjectSearcher(ms,oq);&lt;br /&gt;ManagementObjectCollection moc = mos.Get();&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then I loop through the collection to check out each object's information:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach &lt;/span&gt;(ManagementObject mo &lt;span style="color: rgb(0, 0, 255);"&gt;in &lt;/span&gt;moc)&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if &lt;/span&gt;(&lt;span style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt;.Compare(mo["VolumeName"].ToString(),"myString",&lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;) == 0)&lt;br /&gt;    DirectoryInfo newDI = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;DirectoryInfo(System.IO.Path.Combine(mo["DeviceID"].ToString(), "myPath"));&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;(thanks Shawn, for pointing out the error where I tried to get the volume name from the ManagementObjectCollection, instead of the ManagementObject. While here, I thought I'd go ahead and do the string comparison correctly too. :) )&lt;br /&gt;&lt;br /&gt;So now I have what should be the proper path to the files I want to install.&lt;br /&gt;&lt;br /&gt;Another route to this information is via the ManagementClass class. It is a little cleaner, and a bit quicker to code, but does give you more than you might need for your particular purpose.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;ManagementClass mc = &lt;span style="color: rgb(0, 0, 255);"&gt;new &lt;/span&gt;ManagementClass("Win32_LogicalDisk");&lt;br /&gt;ManagementObjectCollection moc = mc.getInstances();&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach &lt;/span&gt;(ManagementObject mo &lt;span style="color: rgb(0, 0, 255);"&gt;in &lt;/span&gt;moc)&lt;br /&gt;{&lt;br /&gt; &lt;span style="color: rgb(0, 100, 0);"&gt;// Your code here&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Few less lines of code, but a much more generic return on the drive information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-115939012683696492?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/115939012683696492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=115939012683696492&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115939012683696492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115939012683696492'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/09/getting-disk-information-in-c.html' title='Getting Disk Information in C#'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35134354.post-115938874244813540</id><published>2006-09-27T14:16:00.000-06:00</published><updated>2006-09-27T14:51:00.460-06:00</updated><title type='text'>Windows Installer Woes</title><content type='html'>&lt;h3&gt;&lt;span style="color:#0000ff;"&gt;Launching a windows application after install completes in Windows Installer&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;I was tasked at work to become the "install czar" so to speak. For this, I needed to learn some things about the Windows Installer. While there is a pretty good guide for the Windows Installer at Microsoft's &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/windows_installer_guide.asp"&gt;MSDN &lt;/a&gt;site, much of the information was elusive. For instance, I needed information about custom actions. For one installation I created a windows forms application which would copy a boat-load of images from the install DVD to the client machine. The images were about 3Gb in total size, so I didn't want to package them in the install. The install contained a small sampling of the images, and it was bulging at 300+Mb - this takes such a long time to process, checkout, build etc.&lt;br /&gt;&lt;br /&gt;MS has a pretty good &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/custom_action_reference.asp"&gt;CustomAction Reference&lt;/a&gt; page, but it didn't cover everything I was looking at. I went into the setup project I had created in VS 2003, added the .EXE I had created and added it to the "Install" custom action. It seems to me, this should have worked, but it didn't. It appeared the EXE was never called. So I downloaded the&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&amp;displaylang=en"&gt; Windows Platform SDK&lt;/a&gt; which comes with an ultra-cool tool called &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/orca_exe.asp"&gt;Orca&lt;/a&gt; which allows editing of the MSI tables. Looking at the tables, the EXE being called had a type of 1024. However, there was not 1024 type in the reference page.&lt;br /&gt;&lt;br /&gt;Long story short, I found this blog from some guy calling himself &lt;a href="http://bonemanblog.blogspot.com/2005/10/custom-action-tutorial-part-i-custom.html"&gt;Boneman&lt;/a&gt;, which is an excellent tutorial for Custom Actions in the Windows Installer.&lt;br /&gt;&lt;br /&gt;I tried everything I could think of to get this stupid application to launch at the end of the install - nothing seemed to work. Then I went and revisited the Custom Actions section in the VS IDE. What I found was a property settings named "&lt;b&gt;InstallerClass&lt;/b&gt;". I set that to "&lt;b&gt;False&lt;/b&gt;" and voila! It worked!&lt;br /&gt;&lt;br /&gt;But my application was flawed. I didn't know exactly what the working directory would be, I thought it would be the directory from which the install was launched. I was wrong, it was the directory in which the application file was placed. Now I needed to find the correct DVD drive in order to get the images off of it. To accomplish this goal, I imported the kernel32.dll to access the GetDriveType and GetVolumeInformation methods. These two methods return to me the type of drive, and all of the drive information you think you might ever want. Well, actually, the GetDriveType returns a System.Long value, and you have to know what each value represents. Here is how I figured drive type:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;[DllImport("kernel32.dll")]&lt;/span&gt;&lt;br /&gt;public static extern long &lt;span style="color:#000000;"&gt;GetDriveType(&lt;/span&gt;string &lt;span style="color:#000000;"&gt;driveLetter);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;private int &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;DriveType(&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;string &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;asDrive)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   if&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; ((GetDriveType(asDrive) &amp; 5) == 5)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;      return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;5;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   if &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;((GetDriveType(asDrive) &amp; 3) == 3)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;      return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;3;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   if &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;((GetDriveType(asDrive) &amp; 2) == 2)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;      return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;2;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   if &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;((GetDriveType(asDrive) &amp; 4) == 4)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;      return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;4;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   if &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;((GetDriveType(asDrive) &amp; 6) == 6)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;      return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;6;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;   return &lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;0;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, figuring out that 5 is the CD drive took quite a bit of searching, but having the Platform SDK mentioned above sure helps. At any rate, I got the CD drive, then looked for the volume name that I named the DVD during creation. If it locates that and the proper directory is on that disc, then it copies the files. If not, I pop up a folder browse window to allow the user to determine where the image files are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35134354-115938874244813540?l=adventures-in-csharp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adventures-in-csharp.blogspot.com/feeds/115938874244813540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35134354&amp;postID=115938874244813540&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115938874244813540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35134354/posts/default/115938874244813540'/><link rel='alternate' type='text/html' href='http://adventures-in-csharp.blogspot.com/2006/09/windows-installer-woes.html' title='Windows Installer Woes'/><author><name>Bigsibling</name><uri>http://www.blogger.com/profile/17224351304430656784</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='28' src='http://photos1.blogger.com/blogger/5679/3903/1600/adastra_moon.jpg'/></author><thr:total>0</thr:total></entry></feed>
