<?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:blogger='http://schemas.google.com/blogger/2008' 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-1744180953411597783</id><updated>2024-09-05T02:51:24.657-07:00</updated><category term="MVC"/><category term=".net"/><category term="ASP.NET"/><category term="AccessViolationException"/><category term="Apache"/><category term="Apache Tomcat"/><category term="CustomModelBinder"/><category term="DataContractSerializer"/><category term="OCR"/><category term="POCO"/><category term="SOLR"/><category term="SQL"/><category term="Serialization"/><category term="Tesseract"/><category term="TesseractDotNet"/><category term="Tomcat"/><category term="XML"/><category term="c#"/><category term="unmanaged code"/><category term="web application"/><title type='text'>mevans</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-6804251737021056712</id><published>2014-02-14T11:28:00.001-08:00</published><updated>2014-02-14T11:28:39.434-08:00</updated><title type='text'>Configuring IIS 7 for Web Deploy from VS 2012 Publish</title><content type='html'>&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Using the &lt;a href=&quot;http://www.microsoft.com/web/downloads/platform.aspx&quot; target=&quot;_blank&quot;&gt;Web Platform Installer&lt;/a&gt;, install the following:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Web Deploy 3.5 for Hosting Servers&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Web Deploy 3.5*&lt;/div&gt;
&lt;div&gt;
Web Deployment Tool 2.1*&lt;/div&gt;
&lt;div&gt;
Web deploy 3.5 without bundled SQL support (latest)*&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
*I also have these items installed.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWhD2-Q50J_MHVgVv-9k-6nmAMgazwvbsE04xaxkvVdZZCAYPC5q-awda8YIkTuPfDg9-oB5jPFEQPTDl6vfc3N8wO_vkh5LZvn1Uft-p6MddSdhRinNfvPI3On6fA8eXBQRCdgC33Ojk/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWhD2-Q50J_MHVgVv-9k-6nmAMgazwvbsE04xaxkvVdZZCAYPC5q-awda8YIkTuPfDg9-oB5jPFEQPTDl6vfc3N8wO_vkh5LZvn1Uft-p6MddSdhRinNfvPI3On6fA8eXBQRCdgC33Ojk/s1600/Capture.PNG&quot; height=&quot;97&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Restart IIS from the IIS manager.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHMF4V51tpPh25NXWhFdnMugcWvzhTjjl68SxedAU70eLUGonsPAuk5Z_Qs10XsS-I5Gs3BVzbH5p08_mxCtPhB92X_lp3aWo8ttGt3QlVKREnPVsmABPLX-c6IxH9V-vfLxI46zTmwMc/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHMF4V51tpPh25NXWhFdnMugcWvzhTjjl68SxedAU70eLUGonsPAuk5Z_Qs10XsS-I5Gs3BVzbH5p08_mxCtPhB92X_lp3aWo8ttGt3QlVKREnPVsmABPLX-c6IxH9V-vfLxI46zTmwMc/s1600/Capture.PNG&quot; height=&quot;247&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
From the &quot;Connections&quot; tree control, select the server you wish to deploy to, then select the &quot;Management Service&quot; icon from the main view under &quot;Management&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZz_pAljsbxBC6gHHJZxexKPIsUwzayhAOpC6TJ2pwWVvkw2mRG8R7OBnMQ6pme-8Y1eqXlJTlvfNBxNBzN8POT3nV7Z9aOjTQB690YrqHtl65Mzo3puNBqFtmIIoV9uLbmd-OLkR88I/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZz_pAljsbxBC6gHHJZxexKPIsUwzayhAOpC6TJ2pwWVvkw2mRG8R7OBnMQ6pme-8Y1eqXlJTlvfNBxNBzN8POT3nV7Z9aOjTQB690YrqHtl65Mzo3puNBqFtmIIoV9uLbmd-OLkR88I/s1600/Capture.PNG&quot; height=&quot;247&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the Management Service view, Click &quot;Stop&quot; from the &quot;Actions&quot; panel. UNCHECK the checkbox for &quot;Enable remote connections&quot; from the main panel, click &quot;Apply&quot;, and restart click &quot;Start&quot;.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, click &quot;Stop&quot;, RE-CHECK the checkbox for &quot;Enable remote connections&quot;, and then click &quot;Apply&quot; and &quot;Start&quot;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyNC_sMgULhrqomGi6Zc1TgBctdFJSFm2SR6jqk_l6CHu2NU4vdDe3ZKqrCDxBpDJKfXYNfbIBbqYIgAvFr7E5SToyfvl75GkVbqVpfiO3ykE1zqupHitwczp816Xpvz3rhQPT4lcxpI/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyNC_sMgULhrqomGi6Zc1TgBctdFJSFm2SR6jqk_l6CHu2NU4vdDe3ZKqrCDxBpDJKfXYNfbIBbqYIgAvFr7E5SToyfvl75GkVbqVpfiO3ykE1zqupHitwczp816Xpvz3rhQPT4lcxpI/s1600/Capture.PNG&quot; height=&quot;246&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, open up the services.msc control window (start, run, &quot;services.msc&quot;). Verify that &quot;Web Management Service&quot; is in the list of services. If you already had the Services window open, click the &quot;Refresh&quot; button to refresh the list of services before you attempt to verify that the correct services is there and is running.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihTry7OnXSL_qziZopdRc6lVDGZnBjHtyzGMv3ZE8N-l_E57Z9LXLOtE3j_sDnGfAhLt8NASQgYFmD-IiYR9qVFq2yYkP93ceWjWsYbWqqT0goOZRgmcslKAlTuvzkkezpL3IYTaTInoA/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihTry7OnXSL_qziZopdRc6lVDGZnBjHtyzGMv3ZE8N-l_E57Z9LXLOtE3j_sDnGfAhLt8NASQgYFmD-IiYR9qVFq2yYkP93ceWjWsYbWqqT0goOZRgmcslKAlTuvzkkezpL3IYTaTInoA/s1600/Capture.PNG&quot; height=&quot;233&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/6804251737021056712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2014/02/configuring-iis-7-for-web-deploy-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/6804251737021056712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/6804251737021056712'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2014/02/configuring-iis-7-for-web-deploy-from.html' title='Configuring IIS 7 for Web Deploy from VS 2012 Publish'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWhD2-Q50J_MHVgVv-9k-6nmAMgazwvbsE04xaxkvVdZZCAYPC5q-awda8YIkTuPfDg9-oB5jPFEQPTDl6vfc3N8wO_vkh5LZvn1Uft-p6MddSdhRinNfvPI3On6fA8eXBQRCdgC33Ojk/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-5647131063428657461</id><published>2013-10-07T10:39:00.000-07:00</published><updated>2013-10-07T10:39:03.319-07:00</updated><title type='text'>Give User Account sysadmin rights in MS SQL 2008 R2 </title><content type='html'>The IT organization my new job handles all of the software installations, permissions management, etc (an unwelcome change). They failed/forgot to add my account as an administrator in the local SQL Server installation.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here is how to fix that:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;1) Stop SQL Server&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Open &quot;Sql Server Configuration Manager&quot; from the start menu. Select &quot;SQL Server Services&quot; from the left window pane. Right click each service and select &quot;Stop&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;2) Start a single-user instance of SQL Server&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999;&quot;&gt;We will be working with two command windows. This will be command window &quot;A&quot;.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999;&quot;&gt;Open a new command window and navigate to&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999; font-family: Courier New, Courier, monospace;&quot;&gt;C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Start SQL Server in &quot;Single User Admin Mode&quot; by running &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;sqlservr&lt;/span&gt; with the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-m&lt;/span&gt; flag:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999; font-family: Courier New, Courier, monospace;&quot;&gt;sqlservr -m&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;3)&amp;nbsp;&lt;/span&gt;Add the user account as an admin to the SQL Server instance&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
In a 2nd command window,&amp;nbsp;&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt;Command window &quot;B&quot;&lt;/span&gt;, navigate to the same directory&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #b6d7a8; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We will connect to the SQL Server instance we started above by using the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;sqlcmd &lt;/span&gt;tool with the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-s&lt;/span&gt; flag to provide the server&#39;s name, in my case the &quot;(local)&quot; instance, and the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-e&lt;/span&gt; flag to indicate we are connecting using windows authentication.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #b6d7a8; font-family: Courier New, Courier, monospace;&quot;&gt;sqlcmd -s (local) -e&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now that we have connected, we can send commands directly to the SQL Server instance. We will add our user account to the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;sysadmin &lt;/span&gt;group as follows:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: Courier New, Courier, monospace;&quot;&gt;CREATE LOGIN [domain\username] FROM WINDOWS&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: Courier New, Courier, monospace;&quot;&gt;EXEC sp_addsrvrolemember @loginame=&#39;domain\username&#39;, @rolename=&#39;sysadmin&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The account you substituted for domain\username will now be a sysadmin in the database.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;4) Shut down your SQL Server instance and restart SQL Server&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Execute the following commands:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Command Window B&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
shut down SQL Server:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffe599; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;shutdown&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
exit the command window:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #b6d7a8; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;exit&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Command Window A&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
exit the command window:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ea9999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;exit&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, switch back to Sql Server Configuration Manager and start each of the services you previously stopped.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You should now be able to log into the SQL server instance using SQL Server Management Studio, etc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Have a great day :)&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/5647131063428657461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2013/10/give-user-account-sysadmin-rights-in-ms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5647131063428657461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5647131063428657461'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2013/10/give-user-account-sysadmin-rights-in-ms.html' title='Give User Account sysadmin rights in MS SQL 2008 R2 '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-8085955226827151748</id><published>2013-09-24T20:55:00.000-07:00</published><updated>2013-09-24T20:55:15.315-07:00</updated><title type='text'>Start using SASS / SCSS with Compass and Sublime</title><content type='html'>Here are some simple instructions to get you up and running with Compass and SASS/SCSS&lt;br /&gt;
&lt;br /&gt;
First, download and install the ruby interpreter. Ruby is a programming language which the Compass application is written in. If you are on windows, the following is your easiest option:&lt;br /&gt;
&lt;a href=&quot;http://rubyinstaller.org/downloads/&quot;&gt;http://rubyinstaller.org/downloads/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
From the download options select&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;select Ruby 2.0.0-p247&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
during the installation process, check all the check boxes. particularly the one about adding ruby to the path variable.&lt;br /&gt;
&lt;br /&gt;
Next, we will install compass:&lt;br /&gt;
&lt;br /&gt;
Open up a command prompt (start, run,&quot;cmd&quot;).&lt;br /&gt;
At the command prompt, type the following command to install compass:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;gem install compass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Now, in the command window, navigate to the directory of your web project (the directory that has your CSS directory in it)&lt;br /&gt;
&lt;br /&gt;
At the command prompt, type the following command to create a compass project template:&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;compass create TestProject&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
where &quot;TestProject&quot; is the name of the project you want to create.&lt;br /&gt;
&lt;br /&gt;
Additional details on installing Compass can be found at:&lt;br /&gt;
&lt;a href=&quot;http://compass-style.org/install/&quot;&gt;http://compass-style.org/install/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Compass will generate a template project named &quot;TestProject&quot;.&lt;br /&gt;
&lt;br /&gt;
Open the file named &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;config.rb &lt;/span&gt;in a text editor.&lt;br /&gt;
&lt;br /&gt;
You can change the names of the directories in the config file to represent your environment (such as changing the name of the &quot;stylesheets&quot; directory to &quot;CSS&quot; or whatever.)&lt;br /&gt;
&lt;br /&gt;
Now create a file in the same directory as your&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; config.rb &lt;/span&gt;file named &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;compassWatch.bat&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
in the batch file add the line&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;compass watch .&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Notice the &quot;.&quot; which indicate the &quot;current&quot; directory.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now, run the batch file (double click to open file).&lt;br /&gt;
The command in the batch file will tell compass to continually watch the compass project in the current directory and automatically recompile any SASS/SCSS files that are edited and saved into CSS files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You are now ready to create sass files!&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Bonus pro tip:&lt;/span&gt;&lt;br /&gt;
Download Sublime Text 2 text editor from&lt;br /&gt;
&lt;a href=&quot;http://www.sublimetext.com/2&quot;&gt;http://www.sublimetext.com/2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
After installing sublime, download the SASS plugin for sublime:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/n00ge/sublime-text-haml-sass/archive/master.zip&quot;&gt;https://github.com/n00ge/sublime-text-haml-sass/archive/master.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Unzip the contents of the zip file.&lt;br /&gt;
Copy the &quot;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Ruby Haml&lt;/span&gt;&quot; and &quot;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SASS&lt;/span&gt;&quot; directories and paste them into your sublime plugins directory (likely):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;C:\Users\Matthew Evans\AppData\Roaming\Sublime Text 2\Packages&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now, open Sublime open a SCSS file (or create a new file with the .scss extension and save it in your &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TestProject\sass\ &lt;/span&gt;directory)&lt;br /&gt;
&lt;br /&gt;
If sublime does not auto-detect that you are working with a scss file you can force it to use proper syntax:&lt;br /&gt;
&lt;br /&gt;
Press ctrl+shift+p and type &quot;sass&quot; into the filter box and select SASS Syntax.&lt;br /&gt;
Note that you can do this for other types of files. Very handy.&lt;br /&gt;
&lt;br /&gt;
Make your edits to your scss file and save the file.&lt;br /&gt;
Because you have the batch file running in the background, compass will detect the changes to the scss file and auto-compile it into a CSS file.&lt;br /&gt;
&lt;br /&gt;
Now you are REALLY ready to create sass/scss files!&lt;br /&gt;
&lt;br /&gt;
You can learn more about SASS/SCSS at&lt;br /&gt;
&lt;a href=&quot;http://sass-lang.com/tutorial.html&quot;&gt;http://sass-lang.com/tutorial.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://thesassway.com/&quot;&gt;http://thesassway.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Enjoy.</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/8085955226827151748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2013/09/start-using-sass-scss-with-compass-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/8085955226827151748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/8085955226827151748'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2013/09/start-using-sass-scss-with-compass-and.html' title='Start using SASS / SCSS with Compass and Sublime'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-6115161034859201590</id><published>2013-09-08T20:14:00.000-07:00</published><updated>2013-09-08T20:21:48.344-07:00</updated><title type='text'>Problems with Storing Tree Data Structures in a Relational Database</title><content type='html'>Lets say we have data which lends itself to being stored as a tree. There are about nodes including the root, children and leaves or so. Not bad. When I arrived on the scene, the data was being stored as a flat data structure, which gave me the willies. Here is the table schema:
&lt;br /&gt;
&lt;pre class=&quot;brush: sql&quot;&gt; 
CREATE TABLE OrgChart(
  Business nvarchar(255),
  OperatingSegment nvarchar(255),
  ReportingSegment nvarchar(255),
  Company nvarchar(255)
)
&lt;/pre&gt;
My knee-jerk problems complaints against storing the data like this:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;No constraints! - Anything can be entered for any of the fields so we might end up with &quot;texas&quot; and &quot;TX&quot; for state.&lt;/li&gt;
&lt;li&gt;Data is repeated all over the place! - Why would I want to list &quot;United States&quot; for each record?&lt;/li&gt;
&lt;li&gt;No primary key!? - You are searching across nvarchars for each query?!&lt;/li&gt;
&lt;li&gt;What if I want to be able to persist more data about one of the properties, such as add a description field for a given reporting segment. If I were to follow the same pattern, I would just add another column to the OrgChart table named ReportingSegmentDescription. You can just use you imagination on how disgusting that would be.&lt;/li&gt;
&lt;li&gt;The data is LENDING ITSELF TO BEING STORED AS A TREE. It is a hierarchy for pity&#39;s sake. Fix it! Fix it!&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
So. Long story short, I created a much more elegant solution that I thought would solve all these problems and give us the flexibility to expand the data in every direction! Observe:
&lt;br /&gt;
&lt;pre class=&quot;brush: sql&quot;&gt; 
CREATE TABLE OrganizationType(
 Id int not null identity primary key,
 Name varchar(255) not null
 Description varchar(255) not null
)

CREATE TABLE Organization(
 Id int not null identity primary key ,
 Name varchar(255) not null,
 Description varchar(255)
 ParentId int,
 OrganizationTypeId int not null,
 CONSTRAINT FK_OrgType FOREIGN KEY OrganizationTypeId REFERENCES OrganizationType(Id)
)
&lt;/pre&gt;
As you can see this more or less solves all of our problems, doesn&#39;t it? We can do all sorts of things with the data in this tree form that would have been highly impractical before, right? This is better, right!? RIGHT!?
Sadly, no. Not right. You can imagine my disappointment when I experienced how dreadfully slow reading the tree structure was. Think about it, if I want to read the entire tree using NHibernate, I have to recursively execute queries against the database for each node. 
Where the original less-elegant data structure was able to pull down the data and build a tree virtually instantly, the new more elegant solution took a good five seconds. FIVE SECONDS. Now, there are likely several things I could do to improve performance such as:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Don&#39;t use NHibernate.&lt;/li&gt;
&lt;li&gt;Create a Stored Procedure that utilizes a CTE to recursively perform the tree traversal in SQL
But.. think about it, if I do this, what data is the sproc going to return? THE FLAT DATA TABLE WE ORIGINALLY HAD...&lt;/li&gt;
&lt;/ul&gt;
The reality is that while trees are incredible and give us great power, relational database were NOT designed to work with or store them.


Relational database are based in set theory. They deal in collections. They are designed for large flat data structures. That&#39;s the point. If you need to store hierarchical data, FLATTEN IT. That is what the database is for.&lt;br /&gt;
&lt;br /&gt;
Now, we are left with a dissatisfaction in the following two options:&lt;br /&gt;
1) An ugly flat table that is crying out for elegance and flexibility, or

An elegant, but terribly non-performant tree structure.&lt;br /&gt;
2) Are these our only options?&lt;br /&gt;
&lt;br /&gt;
Well, yes. And no. Why not use both?&lt;br /&gt;
&lt;br /&gt;
Some possible options:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Store the data as a tree as we have discussed. Do inserts directly to the Organization table and taylor a stored procedure with a CTE to your reading-needs (such as reading the entire tree).&lt;/li&gt;
&lt;li&gt;Keep both schemas (with a few modifications) and use SQL triggers to sync them. Perform inserts and updates against the tree schema and perform reads against the flat structure.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
I love data structures and making this mistake was indeed a humbling experience. I hate wasting time, but sometimes that is the cost of (re)learning something. Here are some lessons learned from this experience:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Again: Relational DBs are built for flat data structures. Work with the database, not against it.&lt;/li&gt;
&lt;li&gt;Just because the current solution doesn&#39;t seem elegant (to you) doesn&#39;t mean it needs to be changed. Remember the simple axiom: &quot;If it ain&#39;t broke, don&#39;t fix it&quot;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Our flat table solved the original problem of storing the data and allowing it to be read back quickly. This is 90% of what was needed. Just because something could possibly be useful or because it would be &quot;so much better&quot; is never a good enough reason to initiate a refactor. Don&#39;t feel the need to retro-actively&amp;nbsp;over-architect.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp;This post on stack overflow was very insightful and thought provoking:

&lt;a href=&quot;http://stackoverflow.com/questions/3362669/what-is-the-best-way-to-store-a-tree-structure-in-a-relational-db&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/3362669/what-is-the-best-way-to-store-a-tree-structure-in-a-relational-db&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Happy Coding!&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/6115161034859201590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2013/09/problems-with-storing-tree-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/6115161034859201590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/6115161034859201590'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2013/09/problems-with-storing-tree-data.html' title='Problems with Storing Tree Data Structures in a Relational Database'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-5898790588095084360</id><published>2011-11-14T14:47:00.000-08:00</published><updated>2011-11-14T14:47:46.514-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="AccessViolationException"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="OCR"/><category scheme="http://www.blogger.com/atom/ns#" term="Tesseract"/><category scheme="http://www.blogger.com/atom/ns#" term="TesseractDotNet"/><category scheme="http://www.blogger.com/atom/ns#" term="unmanaged code"/><category scheme="http://www.blogger.com/atom/ns#" term="web application"/><title type='text'>AccessViolationException When using tesseractdotnet .net wrapper</title><content type='html'>I recently came across a very annoying issue while writing a web application that utilizes the TesseractDotNet wrapper for Tesseract. I was attempting to have the web application process OCR tasks in an automated task engine. Whenever I called the TesseractEngine.recognise(imgObject) method, I would get the following:&lt;br /&gt;
&lt;br /&gt;
AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&lt;br /&gt;
&lt;br /&gt;
The code that performs all task engine management and OCR functionality lives in a separate DLL file. After several hours of frustration, I tried removing some variability in the problem by creating a test console application and using the DLL project&#39;s functionality from there (instead of the web project). &lt;br /&gt;
&lt;br /&gt;
Amazingly it worked - no problems. &lt;br /&gt;
&lt;br /&gt;
I then tried the same thing with a forms application: again it worked no problem. &lt;br /&gt;
&lt;br /&gt;
It turns out the problem was that the training data file was never properly loaded. The TesseractEngine.init(string trainingDataPath, string language, int mode) method returns &quot;true&quot; if the method successfully loads the training data and &quot;false&quot; otherwise. I had neglected to capture this value and verify that it was == true. As it turns out, it wasn&#39;t . &lt;br /&gt;
&lt;br /&gt;
I was using a relative path in code for the location of the training data file. This relative path was accurate with respect to the console/winforms applications&#39; executables, however the web application&#39;s binaries live in a completely different place! The relative path was in that case inaccurate AND since I was not verifying the return value of the init() method, I was never notified of this problem, so when I went to call the recognize() method, it tries to work without having loaded the training files and fails. &lt;br /&gt;
&lt;br /&gt;
The morals of this story are:&lt;br /&gt;
1) Don&#39;t use relative paths. You never know exactly where your web application will be deployed. Instead add a key/value for the path to your training data in your web/app.config files and get the paths from there.&lt;br /&gt;
2) Always ALWAYS check the return values of your method calls. If a method doesn&#39;t return void, its return value should always be checked for correctness. Its hell to debug something if you make the assumption it is working &quot;properly&quot;.</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/5898790588095084360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2011/11/accessviolationexception-when-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5898790588095084360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5898790588095084360'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2011/11/accessviolationexception-when-using.html' title='AccessViolationException When using tesseractdotnet .net wrapper'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-8681786937885019573</id><published>2010-12-19T16:02:00.000-08:00</published><updated>2013-09-08T19:13:23.320-07:00</updated><title type='text'>Render ASP.MVC Partial Views (*.ascx) to a String</title><content type='html'>It seems like every ASP.Net MVC project I work on requires me to do this, so I thought I would post it.&lt;br /&gt;
&lt;br /&gt;
A particularly useful application of this technique is passing HTML from the server to the browser using JSON requests (AJAX).&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public static string RenderPartialToString(string partialViewPath, ViewDataDictionary viewData, ViewContext viewContext)

{

    ViewPage vp = new ViewPage();

    vp.ViewData = viewData;

    vp.ViewContext = viewContext;

    Control control = vp.LoadControl(partialViewPath);

    vp.Controls.Add(control);

    StringBuilder sb = new StringBuilder();

    using (StringWriter sw = new StringWriter(sb))

    {

        using (HtmlTextWriter tw = new HtmlTextWriter(sw))

        {

            vp.RenderControl(tw);

        }

    }

    return sb.ToString();

}
&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The usage is as follows:&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public JsonResult RenderVacationList(int id)
        {
ViewData.Model = //Some model object from your data store
string v = Helper.RenderPartialToString(&quot;/Views/ControllerName/PartialViewToRender.ascx&quot;, ViewData, new ViewContext());
            return new JsonResult()
            {
                Data = new {
                    view = v
                }
                
            };
        }
&lt;/pre&gt;
You can then call this Action method from your javascript and insert the resulting HTML into the page on the fly! Pretty slick..&lt;br /&gt;
&lt;br /&gt;
As always, leave helpful comments/questions below, Thanks!</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/8681786937885019573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2010/12/render-aspmvc-partial-views-ascx-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/8681786937885019573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/8681786937885019573'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2010/12/render-aspmvc-partial-views-ascx-to.html' title='Render ASP.MVC Partial Views (*.ascx) to a String'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-5904429958705863812</id><published>2010-12-19T15:51:00.000-08:00</published><updated>2010-12-19T15:53:40.110-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache"/><category scheme="http://www.blogger.com/atom/ns#" term="Apache Tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="SOLR"/><category scheme="http://www.blogger.com/atom/ns#" term="Tomcat"/><title type='text'>Setting up SOLR under Apache Tomcat 6 in Windows 7</title><content type='html'>There are other resources out there with this information, but each of them seem to be missing some minor detail or step, so here it is in its complete glory.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This post assumes a fresh windows installation (no other software installed).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;There are three things to download:&lt;/div&gt;&lt;div&gt;&lt;b&gt;1) &lt;/b&gt;&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index.html&quot;&gt;&lt;b&gt;J2SE (Java 2 Standard Edition JRE)&lt;/b&gt;&amp;nbsp;&lt;/a&gt;&amp;nbsp;(click the &quot;Download JRE&quot; button)&lt;/div&gt;&lt;div&gt;&lt;b&gt;2) &lt;a href=&quot;http://tomcat.apache.org/download-60.cgi&quot;&gt;Apache Tomcat 6&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(under &quot;Binary Distributions&quot; click &quot;32-bit/64-bit Windows Service Installer&quot;)&lt;/div&gt;&lt;div&gt;&lt;b&gt;3) &lt;a href=&quot;http://www.apache.org/dyn/closer.cgi/lucene/solr/&quot;&gt;SOLR&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(Click on the &quot;Suggested Mirror&quot; link, select the folder for the most recent version, then download the .zip file)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;4) Install J2SE.&lt;/b&gt;&lt;br /&gt;
This is a no-brainer.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;5) Install Tomcat.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;Using the MSI installer file, this is very straightforward.&lt;/div&gt;&lt;div&gt;Notes:&lt;/div&gt;&lt;div&gt;- When you start the installer, check in ALL the boxes for the different components to install. (if you don&#39;t want them you can remove the manually later)&lt;/div&gt;&lt;div&gt;- Since you installed J2SE first, the path to the JRE will be pre-populated in one of the installer&#39;s dialogs. If it NOT pre-populated, simply find the JRE (&quot;C:\Program Files\Java\jre6&quot; on my machine) and copy/paste its path into the Tomcat installer dialog&#39;s field.&lt;/div&gt;&lt;div&gt;- I left the Tomcat username/password fields blank. This isn&#39;t an issue if you have your firewall setup correctly (outside the scope of this document).&lt;br /&gt;
- At the end of the installation, CHECK the option to start Tomcat when finished.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;6) Install SOLR.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;When I create a new development project (in Visual Studio for example), I keep all associated files/tools/applications in the project&#39;s folder, so in my case I extracted the SOLR folder to my project&#39;s folder. In case you didn&#39;t realize.. extracting SOLR --is-- the &lt;i&gt;installation&lt;/i&gt;. .. now for the &lt;i&gt;configuration&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;b&gt;7) Copy &quot;solr.war&quot;&lt;/b&gt; (or similarly named file which may contain version numbers)&lt;br /&gt;
from the extracted path:&lt;br /&gt;
&quot;...\apache-solr-1.4.1\dist\solr.war&quot;&lt;br /&gt;
to&lt;br /&gt;
&quot;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\&quot;&lt;br /&gt;
or the equivalent path on your machine.&lt;br /&gt;
&lt;br /&gt;
If Tomcat is running (which, if you followed this guide exactly, it should be), you will see another folder appear in &quot;webapps&quot; called &quot;solr&quot; after a few seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;8) Add SOLR to Tomcat.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;When you installed tomcat, you chose to install all components including a handy little Tomcat Monitoring tool located in your system tray.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmVTBAza9MbR96zv-PBUkXWzsYvW4R05EkmKWm8uUNRUsMxf-CKkc0vagol_qrQOycI_amhzvqMhMgZRo0YvkCTIQnHt2FklHWTVOuhyphenhyphenO3RL2c05twdvJtcghNAk01u01eyN7L38YPnL0/s1600/tomcat+system+tray+icon.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmVTBAza9MbR96zv-PBUkXWzsYvW4R05EkmKWm8uUNRUsMxf-CKkc0vagol_qrQOycI_amhzvqMhMgZRo0YvkCTIQnHt2FklHWTVOuhyphenhyphenO3RL2c05twdvJtcghNAk01u01eyN7L38YPnL0/s1600/tomcat+system+tray+icon.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;Double click this icon and go to the &quot;Java&quot; tab.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-KzsjPH_sREvO4pa4jD4lN2eKZ3Q9ciD9XIkxbJnKyONR1Dge2A5XUqWmGUcuJEWrg9YwnF8iwjQfiD7M0c79PcVlGSE5I7KSHLrzY0T3EI1dnR8P2ASgzVMPUGeLvR8qxZP7u6dNlmI/s1600/tomcat+properties+manager.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-KzsjPH_sREvO4pa4jD4lN2eKZ3Q9ciD9XIkxbJnKyONR1Dge2A5XUqWmGUcuJEWrg9YwnF8iwjQfiD7M0c79PcVlGSE5I7KSHLrzY0T3EI1dnR8P2ASgzVMPUGeLvR8qxZP7u6dNlmI/s320/tomcat+properties+manager.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Under &quot;Java Options&quot; add the following line:&lt;/div&gt;&lt;div&gt;&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;-Dsolr.solr.home=.../solr/&lt;/span&gt;&quot;&lt;/div&gt;&lt;div&gt;where ... is the path to your extracted SOLR &quot;installation&quot;. Note that this folder is the one that contains the directories &quot;bin&quot; and &quot;conf&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9) Restart Tomcat service.&lt;/b&gt;&lt;br /&gt;
Now, Click the &quot;General&quot; tab&lt;br /&gt;
- Change &quot;Startup type&quot; to &quot;automatic&quot; (tomcat will start with your computer, if you don&#39;t choose this, you will need to manually start it each time your system starts).&lt;br /&gt;
- Click &quot;stop&quot;&lt;br /&gt;
- Click &quot;start&quot;&lt;br /&gt;
&lt;br /&gt;
Note: This can also be done in service.msc (start -&amp;gt; run-&amp;gt; &quot;service.msc&quot;, press enter).&lt;br /&gt;
&lt;br /&gt;
This will restart the Tomcat Service running on your machine.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;10) Verifying configuration.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now, navigate to&amp;nbsp;&lt;a href=&quot;http://localhost:8080/solr/&quot;&gt;http://localhost:8080/solr/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you see a &quot;Welcome to SOLR!&quot; message, then everything worked. If you get an error page (gray background with white text) then look at the first few lines and try to figure it out. In my experience, the most likely problem is that you got one of the paths wrong (particularly the&amp;nbsp;&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;-Dsolr.solr.home=.../solr/&lt;/span&gt;&quot; path).&lt;br /&gt;
&lt;br /&gt;
Note that after you change any of the paths, or move files around, you need to restart Tomcat (can do it as demonstrated above)&lt;br /&gt;
&lt;br /&gt;
Leave comments/corrections/useful suggestions below!&lt;br /&gt;
Thanks!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/5904429958705863812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2010/12/setting-up-solr-under-apache-tomcat-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5904429958705863812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5904429958705863812'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2010/12/setting-up-solr-under-apache-tomcat-6.html' title='Setting up SOLR under Apache Tomcat 6 in Windows 7'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmVTBAza9MbR96zv-PBUkXWzsYvW4R05EkmKWm8uUNRUsMxf-CKkc0vagol_qrQOycI_amhzvqMhMgZRo0YvkCTIQnHt2FklHWTVOuhyphenhyphenO3RL2c05twdvJtcghNAk01u01eyN7L38YPnL0/s72-c/tomcat+system+tray+icon.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1744180953411597783.post-5994399327808309798</id><published>2010-12-14T22:11:00.000-08:00</published><updated>2010-12-15T18:33:08.015-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="CustomModelBinder"/><category scheme="http://www.blogger.com/atom/ns#" term="DataContractSerializer"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="POCO"/><category scheme="http://www.blogger.com/atom/ns#" term="Serialization"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Storing POCO Properties in SQL server using XML under ASP.NET MVC</title><content type='html'>&lt;div&gt;This technique allows you to easily expand the types of information your database holds without altering the database and with only minimal code additions. In fact, once everything is set up, to start persisting a new property to the database means simply adding that property to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Plain_Old_CLR_Object&quot;&gt;POCO&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;&lt;b&gt;Create your Database&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The only special thing that happens here is that each table that you want to store XML data in will need a column to store the XML string for each record.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;An example table might look like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CREATE TABLE Employee&lt;br /&gt;
(&lt;br /&gt;
EmployeeID INT NOT NULL AUTOINCREMENT PRIMARY KEY,&lt;br /&gt;
FirstName VARCHAR(50) NOT NULL,&lt;br /&gt;
LastName VARCHAR(50) NOT NULL,&lt;br /&gt;
XMLProperties XML&lt;br /&gt;
);&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Notice the 4th column: &quot;XMLProperties&quot; and notice the datatype &quot;XML&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Anything extra that we want to store for an Employee object will be stored in this XMLProperties field. The management of this XML data will all happen in code. That&#39;s all there is to it for the database.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;b&gt;Create your objects&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;The first step is to create your POCO objects. I will use the LINQ-to-SQL tool in VS to automatically generate my objects.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The LINQ-to-SQL tool generates partial classes (a class for each database table).&amp;nbsp;&lt;/div&gt;&lt;div&gt;We will take advantage of this and create supplementary partial classes to add those extra properties we wish to store in XML.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Add Properties to be stored as XML&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Your POCO&#39;s will have properties for the columns of your associated SQL table in the generated partial classes. Lets make our own supplemental partial classes and add our extra properties that will be persisted to XML:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[DataContract(Name = &quot;Employee&quot;, Namespace = &quot;http://www.contoso.com&quot;)]&lt;br /&gt;
public partial class Employee&lt;br /&gt;
{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
[DataMember(Name = &quot;DOB&quot;)]&lt;br /&gt;
public DateTime DOB { get; set;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[DataMember(Name = &quot;Telephone&quot;)]&lt;br /&gt;
public String Telephone { get; set;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Notice the two attributes we are using here &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[DataContract]&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt; and &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[DataMember]&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;.&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[DataContract]&lt;/span&gt;&amp;nbsp;specifies that the class can be used by .NET&#39;s &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx&quot;&gt;DataContractSerializer&lt;/a&gt;, and&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[DataMember]&lt;/span&gt;&amp;nbsp;specifies which properties will be serialized.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Have some way of fetching them and re populating the POCO&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Now comes the tricky part, getting the data in and out seamlessly. While there may be more refined methods of doing this, my solution consists of 2 parts:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1) A &lt;a href=&quot;http://odetocode.com/blogs/scott/archive/2009/04/27/6-tips-for-asp-net-mvc-model-binding.aspx&quot;&gt;Custom Model Binder&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2) A static &quot;Adapter&quot; utility class to serialize and deserialize the objects to and from XML.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I plan on writing my own post on custom model binding in the future. If you are not familiar with the subject, see the link above.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;i&gt;The Adapter Class (Psudo code)&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public static class XMLAdapter&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public static LoadXMLProperties&lt;t&gt;(T Model)&lt;/t&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;foreach(Property p in T.GetProperties())&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;var temp = Deserialize(Model.XMLProperties);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;//use .NET&#39;s reflection framework to get and set the properties&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;if(p is a &quot;datamember property&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; Model.p.value = temp.p.value;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public static SaveXMLProperties&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;t&gt;(T Model)&lt;/t&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;//only the properties with the [DataMember] attribute will be serialized.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Model.XMLProperties = Serialize(Model);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;In our custom model binder&#39;s Bind() method, we will call our&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SaveXMLProperties&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;t&gt;(T Model)&lt;/t&gt;&lt;/span&gt;&amp;nbsp;method on the incoming model. This will take all of our XML backed properties and save them as an XML string in the XMLProperties field of our POCO. Now, when the POCO is persisted, its XML Backed properties will be saved as well.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;To repopulate these XML Backed properties into the POCO (when fetching them from the database), we can call the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;LoadXMLProperties&lt;t&gt;(T Model)&lt;/t&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;on the object in our code wherever it is loaded from the database (such as in the controller).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I plan to revisit this topic later in greater detail.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Hopefully you found this post helpful, if for nothing else than to push you in the right direction.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Post your questions and comments below! Thanks.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mevsauce.blogspot.com/feeds/5994399327808309798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mevsauce.blogspot.com/2010/12/storing-poco-properties-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5994399327808309798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1744180953411597783/posts/default/5994399327808309798'/><link rel='alternate' type='text/html' href='http://mevsauce.blogspot.com/2010/12/storing-poco-properties-in-sql-server.html' title='Storing POCO Properties in SQL server using XML under ASP.NET MVC'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>