<?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-1515491758030471438</id><updated>2025-12-11T11:50:00.354-03:00</updated><category term="VB.Net"/><category term="CSharp"/><category term="SQL Server"/><category term="vs2010"/><category term="Android"/><category term="Javascript"/><category term="Telerik"/><category term="WinForms"/><category term="vs2012"/><category term="ASP"/><category term="ASP.Net"/><category term="CSS"/><category term="IE10"/><category term="Installshield"/><category term="Open Access"/><category term="Outlook"/><category term="SQL CE 4.0"/><category term="Setup"/><category term="Sync"/><category term="TSQL"/><category term="Xamarin"/><category term="vmware"/><category term="vs2013"/><title type='text'>The source of my code...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-1783639632730888505</id><published>2014-07-14T14:33:00.000-03:00</published><updated>2014-07-14T14:33:27.988-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="vmware"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2012"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Xamarin"/><title type='text'>Using a VMware Android emulator in Visual Studio</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;This is &lt;u&gt;not&lt;/u&gt; a &quot;manual&quot; on how to create a VMware android virtual machine!&lt;/span&gt;&lt;/blockquote&gt;
This is just a hint on how to use a virtual andoid in your Visual Studio environment... I&#39;m not going to explain how to create the android vmware, just how to &quot;connect&quot; to it...&lt;br /&gt;
For android x86 install instructions, please goto &lt;a href=&quot;http://xmodulo.com/2013/02/how-to-install-and-run-android-vm-on-vmware-player.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;the xmodulo site&lt;/a&gt;.&lt;br /&gt;
&lt;h4&gt;
&lt;br /&gt;My problem&lt;/h4&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.xamarin.com/&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimHPq_fJAl74y_Zn1dwpeJ2grU5X6ZJHJ3-U8l-v8rp-HBwJK3pT4mapN60WXcWwCnKCMDBOnHy4YMVaSABKVbRtsfJyb9zKUpzYnYSKKRMlTitLem9W7b00zwS3GuEHpT6Kjz3IzMYWI/s1600/xamarin.png&quot; /&gt;&lt;/a&gt;
I&#39;m using &lt;a href=&quot;http://www.xamarin.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Xamarin &lt;/a&gt;to create mobile applications. When you install the development tools for your Visual Studio instance, it installs (among many other things) the &quot;AVD Manager&quot;&lt;br /&gt;
This &quot;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;A&lt;/b&gt;&lt;/span&gt;ndroid &lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;V&lt;/b&gt;&lt;/span&gt;irtual &lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;D&lt;/b&gt;&lt;/span&gt;evice Manager&quot; allows you to create virtual android devices to test your applications. In theory this is a nice feature. You don&#39;t need an android device to test your app... In practice however it sucks...&lt;br /&gt;
The virtual androids are extremely slow and -more of a problem- have maximum available memory issues when emulated in a windows environment.&lt;br /&gt;
&lt;h4&gt;
&lt;br /&gt;problem solved?&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.android-x86.org/download&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEOIJTRNKGdCx04nTsQTn3595MQ01lUuP0L2ud8d_RjNDj1XYUeS-SG3I6AyB1TPiajtwYqBawIqy6jD9zW7_3-ieWV_Jp7slU3_hvc-AlNdmbu40dQ6OMYgsBABh5H-74K0BXY_D_jr4/s1600/android.png&quot; height=&quot;263&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;The first step was to &lt;a href=&quot;http://www.android-x86.org/download&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; a x86 android ISO and create a android virtual machine.&lt;br /&gt;
&lt;br /&gt;
This is a relatively easy excercise. &lt;br /&gt;
&lt;br /&gt;
There was a little caveat with the network adapter. It should be changed to &quot;vlance&quot; &lt;i&gt;before the first start of the virtual machine&lt;/i&gt;, but other then that it was easy enough.&lt;br /&gt;
&lt;br /&gt;
The virtual android was up and running within 30 min. including downloading the ISO.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
However... as always this was too easy... For good reasons -which I will not elaborate on- my development 
environment is also running in a virtual machine! How did I connect the 
virtual android to the Visual Studio enviroment in another virtual 
machine?&lt;/div&gt;
&lt;h4 class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;Problem solved!&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Turns out it&#39;s just a small trick... &lt;br /&gt;
When Visual Studio starts (with Xamarin installed)&amp;nbsp; it searches for &lt;span style=&quot;color: #990000;&quot;&gt;&lt;i&gt;local(!)&lt;/i&gt;&lt;/span&gt; available android devices. To connect to the (&lt;i&gt;remote&lt;/i&gt;) android virtual machine you should open the adb command prompt:&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuER4eWK_ro_ZyG4GaXeAhlylD-U_HRY_ZJrKHo9S1tljdS5F99dAfiCol8nTnoPTR9MU6Zz6QcmlydvQnjY3z8eC34RqfbqNg8vGwiqLJ57BWvlftGpakALGYzL8GIgqQZxR8uFJ-hE/s1600/adb_start.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuER4eWK_ro_ZyG4GaXeAhlylD-U_HRY_ZJrKHo9S1tljdS5F99dAfiCol8nTnoPTR9MU6Zz6QcmlydvQnjY3z8eC34RqfbqNg8vGwiqLJ57BWvlftGpakALGYzL8GIgqQZxR8uFJ-hE/s1600/adb_start.png&quot; height=&quot;108&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;ADB command prompt&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
At the command prompt you connect to your virtual android using the command:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;adb connect 192.168.1.110&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Where 192.168.1.110 is the&lt;b&gt; ip-adress of my android emulator&lt;/b&gt;. (The IP will probably be different in your environment ;-) &lt;/span&gt;You can check if you successfully connected using
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;adb devices&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
If you are connected, it should list the vm in the devices list.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;You can find the android emulator ip by running the android console with ALT-F1**, then run netcfg to get the ip address. With ALT-F7** you return to the android GUI..&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;If all turned out okay, your vmware device should be listed in your available devices for debugging:&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZlKhaBgINzQD3R3J5N9UgWRxb90y16n7lolMIEtjMR598fAQTz4OzSs-FeF5PBr-dssIoPAsovTN6l7W2Nm5nJ7BoGwpxAI4JLx-ZJjuYLQwm-iYyGSTixdWWoLEJiOfTJbWdCUhNnFo/s1600/adb_cn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZlKhaBgINzQD3R3J5N9UgWRxb90y16n7lolMIEtjMR598fAQTz4OzSs-FeF5PBr-dssIoPAsovTN6l7W2Nm5nJ7BoGwpxAI4JLx-ZJjuYLQwm-iYyGSTixdWWoLEJiOfTJbWdCUhNnFo/s1600/adb_cn.png&quot; height=&quot;108&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;VMware, virtual android device&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
** NOTE: In my android (4.3) ALT-F1/F7 switched console/gui, however I&#39;ve read CTRL-F1/F7 might do the trick in different x86 ISO&#39;s/versions.&lt;/div&gt;
&lt;h4 class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;Hints and tips...&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
The vmware emulator is certainly not a perfect solution, but it is a lot faster than the standard java SDK emulators. And if you&#39;re not using all kinds of sensory input it&#39;s a real alternative!&lt;br /&gt;
When your unable to connect, check firewall settings. An android adb connection typically connects on port 5555. Make sure it&#39;s not blocked.&lt;br /&gt;
In your android emulator you might need to set your netwok configuration to make this all work (see the batch file below)&lt;br /&gt;
&lt;br /&gt;
You can very easily change your device screen size on the android emulation. Open the console (ALT-F1) and set your desired resolution:&lt;br /&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;wm size 1280x800&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
I&#39;ve create a batch file to connect to my emulator(s). The batchfile has a dependence on Visual Studio Environment variables. It&#39;s located in the vs folder&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The shortcut on the desktop uses the %comspec% variable:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;%comspec% /c &quot;&quot;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\connectvmwaredroid.bat&quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
If I did not include the envronment variables, the connection got lost when Visual Studio starts up? It -most likely- resets the adb..&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; @ECHO OFF  
 ECHO ==================================================================  
 ECHO In the android vmware: press ALT+F1 to open console  
 ECHO Then enter netcfg to find the emulator IP  
 ECHO If eth0 is not UP then enter (in the android emulator console):  
 ECHO netcfg eth0 up  
 ECHO netcfg setprop net.dsn1 8.8.8.8  
 ECHO ALT-F7 to close the console  
 ECHO ==================================================================  
 ECHO - set dev environment settings...  
 if not exist &quot;%~dp0bin\x86_amd64\vcvarsx86_amd64.bat&quot; goto missing  
 call &quot;%~dp0bin\x86_amd64\vcvarsx86_amd64.bat&quot;  
 cd %LocalAppData%\Android\android-sdk\platform-tools  
 ECHO - disconnect all devices...  
 adb kill-server  
 SET /P emu_ip=Enter the emulator ip:   
 :connect  
 ECHO - Connecting emulator...  
 rem ping %emu_ip%  
 adb connect %emu_ip%  
 adb devices  
 SET /P emu_ip=Next emulator ip (x to exit):   
 IF &quot;%emu_ip%&quot; == &quot;x&quot; goto done  
 goto connect  
 :missing  
 ECO Could not set environment variables. Connection to emulator failed...  
 :done  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Hope this post was helpfull to anyone :-)&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/1783639632730888505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2014/07/using-vmware-android-emulator-in-visual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1783639632730888505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1783639632730888505'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2014/07/using-vmware-android-emulator-in-visual.html' title='Using a VMware Android emulator in Visual Studio'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEimHPq_fJAl74y_Zn1dwpeJ2grU5X6ZJHJ3-U8l-v8rp-HBwJK3pT4mapN60WXcWwCnKCMDBOnHy4YMVaSABKVbRtsfJyb9zKUpzYnYSKKRMlTitLem9W7b00zwS3GuEHpT6Kjz3IzMYWI/s72-c/xamarin.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-1574037657620797433</id><published>2013-04-12T14:40:00.000-03:00</published><updated>2013-04-12T14:57:51.513-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Installshield"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL CE 4.0"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2010"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2012"/><title type='text'>Installshield 2012 Spring LE: SQL CE (Compact Edition) 4.0 Prerequisite</title><content type='html'>Recently I&#39;ve did a complete reinstall of my laptop because of an upgrade to MS Windows 8. (Whether that&#39;s&amp;nbsp;the first&amp;nbsp;mistake in this story is entirely your opinion *grin*). After that MS SQL Server 2012 (Express), followed by Visual Studio 2012. All shiny and new as a figure of speech...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My problem&lt;/h4&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM-AgedPUWe50PX38Ai0zj7kYt5L3H5WS5gvP7twUs3PHP8etFDPn_wJjjsWIO04YZrjpK6_hfG4nszU0mCHqEs5RG_TCY_N3TiiRDCSg5qDgQh-IJ1YxDO6b-BeHvgg6tpTX8kRlptIk/s1600/ceLogo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;91&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM-AgedPUWe50PX38Ai0zj7kYt5L3H5WS5gvP7twUs3PHP8etFDPn_wJjjsWIO04YZrjpK6_hfG4nszU0mCHqEs5RG_TCY_N3TiiRDCSg5qDgQh-IJ1YxDO6b-BeHvgg6tpTX8kRlptIk/s200/ceLogo.jpg&quot; width=&quot;100&quot; /&gt;&lt;/a&gt;Next: import a Visual Studio 2010 solution into my new (and still shiny) Visual Studio 2012. It was a standard winforms app. One tiny (easily solvable) problem occurred: The solution contained a SQL CE&amp;nbsp; database, &lt;em&gt;version 3.5&lt;/em&gt;. On my shiny new Win8 system &lt;em&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms172417.aspx&quot; target=&quot;_blank&quot;&gt;SQL CE 4.0&lt;/a&gt;&lt;/em&gt; was installed, either by windows itself, visual studio or SQL server 2012? (Who knows, who cares?)&amp;nbsp;So I updated the references in my project to the new SQL CE objects and sure enough it compiled and ran smoothly.&lt;br /&gt;
&lt;br /&gt;
Visual Studio 2012 doesn&#39;t support the 2010 Visual Studio Installer projects. This forced me to create a new Setup and Deployment project in Flexera&#39;s Installshield 2012&amp;nbsp;Spring Limited Edition. And here problems started to rise...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Prerequisite troubles...&lt;/h4&gt;
&lt;br /&gt;
To start with: The &quot;Light Edition&quot; is severely crippled (imho). It&#39;s really the absolute minimum which enables you to create a setup file, but there&#39;s very little room to tailor it. I guess they (flexera)&amp;nbsp;think by&amp;nbsp;doing so we&#39;re forced to buy the full version?!?!&lt;br /&gt;
Back to the problem: You can add prerequisites to the installer, this is the good news. The bad news however: there&amp;nbsp;is no SQL CE 4.0 prerequisite to be found anywhere!!!!&lt;br /&gt;
Now what?&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem solved&lt;/h4&gt;
&lt;br /&gt;
To shorten the story&amp;nbsp;(I assume&amp;nbsp;you&#39;re not interested in my frustration leading to the solution) I&#39;ve figured out how to create a custom prerequisite to install SQL CE 4.0 with my application installer.&lt;br /&gt;
&lt;br /&gt;
﻿&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5S3PPUN6HvYXykkKhAcjYzUdXUHeXS_rH2_s8XAujiTZermOsnBSvSoS5P7bwiT-Dm4kS1OwMr-ye1ffscrBERQlZ3SrFAdHS9u5kzYpkBCNHvYnhe4LMrWuaqK0OzWeLS1II2Enw53Y/s1600/installshield.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;382&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5S3PPUN6HvYXykkKhAcjYzUdXUHeXS_rH2_s8XAujiTZermOsnBSvSoS5P7bwiT-Dm4kS1OwMr-ye1ffscrBERQlZ3SrFAdHS9u5kzYpkBCNHvYnhe4LMrWuaqK0OzWeLS1II2Enw53Y/s640/installshield.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Install Shield 2012 LE - Prerequisites...&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;
Step 1&amp;nbsp;&lt;/h3&gt;
Download the SQL Server Compact redistributables from the Microsoft Download Center at &lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=30709&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=30709&lt;/a&gt;. &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;SSCERuntime_x86-ENU.exe&lt;/li&gt;
&lt;li&gt;SSCERuntime_x64-ENU.exe&lt;/li&gt;
&lt;/ul&gt;
SQL Server Compact 4.0 is freely redistributable under a redistribution license agreement. You need to download both installers (x86 and x64)&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 2&lt;/h3&gt;
Create the prerequisite files for Installshield. First of all a big thank you for posting the most important part of the solution on Stack Overflow&amp;nbsp;by &lt;a href=&quot;http://stackoverflow.com/questions/9181157/sql-ce-4-0-as-a-installshield-prerequisite&quot; target=&quot;_blank&quot;&gt;Enzero&lt;/a&gt;&amp;nbsp;This helped me big time. &lt;br /&gt;
With version 3.5 of CE there was a single installer for both x86 and x64. With 4.0 there are two separate installers. This is where I needed to tweak Enzero&#39;s solution. A check if my app is installed on a 32 or 64 bit OS.&lt;br /&gt;
&lt;br /&gt;
So the &quot;tinkered&quot; scripts are now:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;Microsoft SQL CE 4.0 SP1 (x86).prq&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;-ms-word-wrap: normal; color: black;&quot;&gt; &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;  
 &amp;lt;SetupPrereq&amp;gt;  
      &amp;lt;conditions&amp;gt;  
           &amp;lt;condition Type=&quot;4&quot; Comparison=&quot;2&quot; Path=&quot;[ProgramFilesFolder]\Microsoft SQL Server Compact Edition\v4.0&quot; FileName=&quot;sqlceca40.dll&quot; ReturnValue=&quot;&quot; Bits=&quot;2&quot;/&amp;gt;  
      &amp;lt;/conditions&amp;gt;  
      &lt;b&gt;&amp;lt;operatingsystemconditions&amp;gt;  
            &amp;lt;operatingsystemcondition Bits=&quot;1&quot;&amp;gt;&amp;lt;/operatingsystemcondition&amp;gt;  
       &amp;lt;/operatingsystemconditions&amp;gt;  &lt;/b&gt;
      &amp;lt;files&amp;gt;  
           &amp;lt;file LocalFile=&quot;&amp;amp;lt;ISProductFolder&amp;amp;gt;\SetupPrerequisites\SQL CE 4.0 SP1\SSCERuntime_x86-ENU.exe&quot; URL=&quot;http://download.microsoft.com/download/F/F/D/FFDF76E3-9E55-41DA-A750-1798B971936C/ENU/SSCERuntime_x86-ENU.exe&quot; FileSize=&quot;0,0&quot; /&amp;gt;  
      &amp;lt;/files&amp;gt;  
      &amp;lt;execute file=&quot;SSCERuntime_x86-ENU.exe&quot; cmdline=&quot;/i /passive&quot; cmdlinesilent=&quot;/i /passive&quot; /&amp;gt;  
      &amp;lt;properties Id=&quot;{05DCCDB5-57E0-4314-A016-874F228A8FAD}&quot; Description=&quot;This prerequisite installs the Microsoft SQL Server Compact 4.0 SP1. (x86 32bit edition)&quot;/&amp;gt;  
 &amp;lt;/SetupPrereq&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;Microsoft SQL CE 4.0 SP1 (x64).prq&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;-ms-word-wrap: normal; color: black;&quot;&gt; &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;  
 &amp;lt;SetupPrereq&amp;gt;  
      &amp;lt;conditions&amp;gt;  
           &amp;lt;condition Type=&quot;4&quot; Comparison=&quot;2&quot; Path=&quot;[ProgramFilesFolder]\Microsoft SQL Server Compact Edition\v4.0&quot; FileName=&quot;sqlceca40.dll&quot; ReturnValue=&quot;&quot; Bits=&quot;2&quot;/&amp;gt;  
      &amp;lt;/conditions&amp;gt;  
      &lt;b&gt;&amp;lt;operatingsystemconditions&amp;gt;  
            &amp;lt;operatingsystemcondition Bits=&quot;4&quot;&amp;gt;&amp;lt;/operatingsystemcondition&amp;gt;  
       &amp;lt;/operatingsystemconditions&amp;gt;   &lt;/b&gt;
      &amp;lt;files&amp;gt;  
           &amp;lt;file LocalFile=&quot;&amp;amp;lt;ISProductFolder&amp;amp;gt;\SetupPrerequisites\SQL CE 4.0 SP1\SSCERuntime_x64-ENU.exe&quot; URL=&quot;http://download.microsoft.com/download/F/F/D/FFDF76E3-9E55-41DA-A750-1798B971936C/ENU/SSCERuntime_x64-ENU.exe&quot; FileSize=&quot;0,0&quot;/&amp;gt;  
      &amp;lt;/files&amp;gt;  
      &amp;lt;execute file=&quot;SSCERuntime_x64-ENU.exe&quot; cmdline=&quot;/i /passive&quot; cmdlinesilent=&quot;/i /passive&quot; /&amp;gt;  
      &amp;lt;properties Id=&quot;{05DCCDB5-57E0-4314-A016-874F228A8FAD}&quot; Description=&quot;This prerequisite installs the Microsoft SQL Server Compact 4.0 SP1. (x64 64bit edition)&quot;/&amp;gt;  
 &amp;lt;/SetupPrereq&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 3&lt;/h3&gt;
To make this voodoo all come to life we need one last step. When Installshield Spring LE was default installed the prerequisite folder should be located here:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;C:\Program Files (x86)\InstallShield\2012SpringLE\SetupPrerequisites&lt;/span&gt;&lt;br /&gt;
At this location create 2 &quot;.prq&quot; files (with any text editor -notepad will do-):&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft SQL CE 4.0 SP1 (x86).prq&lt;/li&gt;
&lt;li&gt;Microsoft SQL CE 4.0 SP1 (x64).prq&lt;/li&gt;
&lt;/ul&gt;
Paste the XML from above in the created files. The x86 content in the x86 file and the x64 content in the x64 file. Make sure the extension of the files is &quot;&lt;span style=&quot;color: red;&quot;&gt;.prq&lt;/span&gt;&quot; (especially when using notepad!)&lt;br /&gt;
&lt;br /&gt;
In this folder you also need to create a new subfolder: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;SQL CE 4.0 SP1&lt;/span&gt;&lt;br /&gt;
In this &quot;SQL CE 4.0 SP1&quot;-folder you mustcopy the two downloaded redistributable files from Microsoft: SSCERuntime_x86-ENU.exe &amp;amp; SSCERuntime_x64-ENU.exe&lt;br /&gt;
&lt;br /&gt;
Watch carefully when adding the folder with redistributable files. The naming is used in both .prq XML content.&lt;br /&gt;
&lt;br /&gt;
That&#39;s it! &lt;br /&gt;
Now, when you look at the redistributables in your Visual Studio setup project, you should see the x86 and x64 SQL CE 4.0&amp;nbsp;prerequisites. If you&#39;re not sure if your app is going to be installed on a x86 Windows OS or an x64. just add both! The &quot;&amp;lt;operatingsystemconditions&amp;gt;&quot; part in the XML checks if the prerequisite should be installed based on the architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Keep in mind...&lt;/h4&gt;
&lt;br /&gt;
Though this &quot;trick&quot; does work and does install SQL CE 4.0 with your applications setup, beware this is not an official prerequisite!&amp;nbsp;I don&#39;t think it&#39;s&amp;nbsp;illegal either (&quot;freely redistributable under a redistribution license agreement&quot;)&lt;br /&gt;
&lt;em&gt;Other then this, you&#39;re good.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
It took me a few free evenings to figure this one out. I hope you find this info useful and it didn&#39;t took you that long for you to find my blog entry :o)</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/1574037657620797433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2013/04/installshield-2012-spring-le-sql-ce.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1574037657620797433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1574037657620797433'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2013/04/installshield-2012-spring-le-sql-ce.html' title='Installshield 2012 Spring LE: SQL CE (Compact Edition) 4.0 Prerequisite'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEgM-AgedPUWe50PX38Ai0zj7kYt5L3H5WS5gvP7twUs3PHP8etFDPn_wJjjsWIO04YZrjpK6_hfG4nszU0mCHqEs5RG_TCY_N3TiiRDCSg5qDgQh-IJ1YxDO6b-BeHvgg6tpTX8kRlptIk/s72-c/ceLogo.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-1165024876279027379</id><published>2013-04-05T10:11:00.002-03:00</published><updated>2013-04-05T10:11:38.489-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="TSQL"/><title type='text'>TSQL: Count / SUM with &#39;Where&#39; condition</title><content type='html'>&lt;h4&gt;
My problem&lt;/h4&gt;
Doing some reporting services I found myself in need to have group aggregates. I try to solve most hurdles in the SQL queries so I don&#39;t need to much trickery in the report definitions.&amp;nbsp;I&#39;ve done these queries many times and usually found myself doing sub queries from the main one, or using temporary tables etc. &lt;br /&gt;
&lt;br /&gt;
Imagine this question based on the tables below: &lt;em&gt;How many herbivores with what total value are in my zoo?&lt;/em&gt;&lt;br /&gt;
﻿&lt;br /&gt;
﻿&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0uxzd6Mn9HJpIYIZ0xBCnMqRdLerJzQckna5EZJZw7pVs2Vd5VPwxQzeeuG4s610hioH6VODqimZ0WSc802firWso6qY-1YBP2oSePixuq1kYIf1aVBC08md118yjRbi79apn52pMJmc/s1600/GroupTables.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0uxzd6Mn9HJpIYIZ0xBCnMqRdLerJzQckna5EZJZw7pVs2Vd5VPwxQzeeuG4s610hioH6VODqimZ0WSc802firWso6qY-1YBP2oSePixuq1kYIf1aVBC08md118yjRbi79apn52pMJmc/s1600/GroupTables.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Example tables :)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h4&gt;
Problem solved!&lt;/h4&gt;
I&#39;ve found the answer on&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/11676226/tsql-count-where-condition&quot; target=&quot;_blank&quot;&gt;Stack Overflow&lt;/a&gt;.&amp;nbsp;The trick is using a &#39;&lt;span style=&quot;color: blue;&quot;&gt;join&lt;/span&gt;&#39; and a&amp;nbsp;&#39;&lt;span style=&quot;color: green;&quot;&gt;case when&lt;/span&gt;&#39; in your count/sum syntax. So the query to answer the question above is like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;-ms-word-wrap: normal; color: black;&quot;&gt; SELECT dbo.Food.[Description] as Food  
     ,COUNT(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;CASE dbo.Species.FoodID WHEN dbo.Food.Id THEN 1 ELSE null END&lt;/span&gt;) AS [Count]  
     ,SUM((&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;CASE dbo.Species.FoodID WHEN dbo.Food.Id THEN dbo.Species.Value ELSE null END&lt;/span&gt;) AS Value  
  FROM dbo.Species  
  &lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;LEFT JOIN dbo.Food ON dbo.Species.FoodID = dbo.Food.Id&lt;/span&gt; 
  GROUP BY dbo.Food.[Description]  
 GO  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
And the result:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWlbjPoKYp2AZ8wGnC8B0Se1JUs7pgeUEqd3CCkdFIRwidctZAxOSK7xB0z_n4wdL7O1C2NnlhFM6vbg2h0uI-e3776hB_h76-LpkRXFtjRXV319s_I4zTJC8SWR6wWGbj0F6SO6vGV78/s1600/result.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWlbjPoKYp2AZ8wGnC8B0Se1JUs7pgeUEqd3CCkdFIRwidctZAxOSK7xB0z_n4wdL7O1C2NnlhFM6vbg2h0uI-e3776hB_h76-LpkRXFtjRXV319s_I4zTJC8SWR6wWGbj0F6SO6vGV78/s1600/result.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The expected result of the query&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
﻿</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/1165024876279027379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2013/04/tsql-count-sum-with-where-condition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1165024876279027379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1165024876279027379'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2013/04/tsql-count-sum-with-where-condition.html' title='TSQL: Count / SUM with &#39;Where&#39; condition'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEi0uxzd6Mn9HJpIYIZ0xBCnMqRdLerJzQckna5EZJZw7pVs2Vd5VPwxQzeeuG4s610hioH6VODqimZ0WSc802firWso6qY-1YBP2oSePixuq1kYIf1aVBC08md118yjRbi79apn52pMJmc/s72-c/GroupTables.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-6167118762394831065</id><published>2013-03-18T09:26:00.000-03:00</published><updated>2013-03-18T09:26:40.263-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="IE10"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>IE10: ImageButton PageRequestManagerServerErrorException</title><content type='html'>&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/AVvXsEi1xbiJYSRdukXcU6gf-WdaM2fjIDy8RM-vZOcaYYw6S4Xprg_52_dkqtYa0J1JyB5Y19P1gmpfuTNdInu_kh_Ri2OwysgPdVuYII5MRnmKXL-Rngn4D5t_kiyy7_kT3kQMfqguU2uBgl4/s1600/js.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1xbiJYSRdukXcU6gf-WdaM2fjIDy8RM-vZOcaYYw6S4Xprg_52_dkqtYa0J1JyB5Y19P1gmpfuTNdInu_kh_Ri2OwysgPdVuYII5MRnmKXL-Rngn4D5t_kiyy7_kT3kQMfqguU2uBgl4/s320/js.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
And behold the puzzling cryptic error message above, kindly displayed by Internet Explorer 10 when viewing a page from an application&amp;nbsp;which is flawlessly displayed in any other browser....&lt;br /&gt;
Yes, including IE9 and below?!?!&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
They dit it again...&lt;/h4&gt;
The boys at Redmond kept me busy for an hour or so! To make a long story short: IE10 has a problem with ImageButtons. Only God knows why, but somebody decided the image button click &lt;strong&gt;post back location&lt;/strong&gt; values should change from &lt;strong&gt;integer to decimal&lt;/strong&gt; and somehow jQuery doesn&#39;t agree with that.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Now what?&lt;/h4&gt;
Roaming the web I&#39;ve found numerous references to this issue and some fixes.&amp;nbsp;One of them was updating the &lt;a href=&quot;http://connect.microsoft.com/VisualStudio/feedback/details/755419/asp-net-4-0-and-ie10-click-on-imagebutton-in-updatepanel-produces-error-click-on-normal-button-does-not&quot; target=&quot;_blank&quot;&gt;.Net framework version to 4.5&lt;/a&gt;&amp;nbsp;&lt;em&gt;of the clients&lt;/em&gt; another &#39;fix&#39; suggested to replace the image buttons with another control all together..&lt;br /&gt;
Both were not an option. After some more extensive search I&#39;ve found the best solution (imho):&lt;br /&gt;
&lt;br /&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/AVvXsEgDEDb9ClHxPDCkUfSTiRAtzrr7LN9m8NPSzzKp8fZWv4WutzZgIhuhFB5KoXyPNZH_BDpccmqXn-EDyGia9aeuWaJjglvFYj1kbhrROT5Oig6SuOPpsX8g5FhOzFRSpl3SZBuHduYUXiw/s1600/header.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDEDb9ClHxPDCkUfSTiRAtzrr7LN9m8NPSzzKp8fZWv4WutzZgIhuhFB5KoXyPNZH_BDpccmqXn-EDyGia9aeuWaJjglvFYj1kbhrROT5Oig6SuOPpsX8g5FhOzFRSpl3SZBuHduYUXiw/s640/header.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
By forcing IE9 compatibility the problem was fixed. Adding the X-UA-Compatible tag to the master page the problem was solved and all things works as designed....&lt;br /&gt;
&lt;br /&gt;
Don&#39;t you love wild goose chases once in a while?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/6167118762394831065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2013/03/ie10-imagebutton-pagerequestmanagerserv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/6167118762394831065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/6167118762394831065'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2013/03/ie10-imagebutton-pagerequestmanagerserv.html' title='IE10: ImageButton PageRequestManagerServerErrorException'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEi1xbiJYSRdukXcU6gf-WdaM2fjIDy8RM-vZOcaYYw6S4Xprg_52_dkqtYa0J1JyB5Y19P1gmpfuTNdInu_kh_Ri2OwysgPdVuYII5MRnmKXL-Rngn4D5t_kiyy7_kT3kQMfqguU2uBgl4/s72-c/js.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-5382596592540132849</id><published>2013-03-13T11:27:00.000-03:00</published><updated>2013-03-13T11:27:36.783-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><title type='text'>VB.Net: SQL Server Image column to PicturBox Bitmap</title><content type='html'>&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/AVvXsEjGa64lmNvLlAlZrwXnyF0_BawqYrbNRHO_0L-QbXbDr5Uzo04TSnJEIbGHwHaOUFtd_DVbvdOkeoE9miaqgiJex4T35Xp2EG2m7ZuSGXTnIAGR5z-1yRjQ4aqTCj-NqFkAgh2ICg7F4ks/s1600/table.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGa64lmNvLlAlZrwXnyF0_BawqYrbNRHO_0L-QbXbDr5Uzo04TSnJEIbGHwHaOUFtd_DVbvdOkeoE9miaqgiJex4T35Xp2EG2m7ZuSGXTnIAGR5z-1yRjQ4aqTCj-NqFkAgh2ICg7F4ks/s1600/table.png&quot; height=&quot;146&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
There&#39;s always a debate at the office whether images should be stored in the database or in the file structure. I prefer the database, using the SQL Server &quot;image&quot; column data type. &lt;br /&gt;
This way there is no need to set authentication on the file server folders who can and cannot access the location of the images.&lt;br /&gt;
&lt;br /&gt;
Usually the &#39;location&#39; is still saved in a database column. When accessing the image at the stored location you have to catch exceptions if someone deleted the image from the server without updating the &#39;location&#39; in the database. &lt;br /&gt;
&lt;br /&gt;
When reading and writing one uses a byte array to &#39;communicate&#39; the data. Consider the table above where the image column is &quot;FactuurHeader&quot;.&lt;br /&gt;
&lt;br /&gt;
Check the example &quot;read&quot; code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Public Shared Function GetHeader(ByVal cnStr As String) As Bitmap  
     &#39;default (empty) logo  
     Dim logo As New Bitmap(100, 108)  
     Using cn As New SqlConnection(cnStr)  
       cn.Open()  
       Using cmd As New SqlCommand()  
         cmd.CommandText = &quot;SELECT TOP 1 FactuurHeader FROM dbo.tblPraktijk WHERE Actief=1&quot;  
         cmd.Connection = cn  
         Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)  
         If dr.HasRows Then  
           dr.Read()  
           If Not dr.Item(&quot;FactuurHeader&quot;).Equals(DBNull.Value) Then  
             &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;Here&#39;s the voodoo: from image column data to bitmap... &lt;/span&gt;
             Dim imgData() As Byte = DirectCast(dr.Item(&quot;FactuurHeader&quot;), Byte())  
             If imgData.Length &amp;gt; 0 Then  
               Dim stream As New MemoryStream(imgData)  
               logo = New Bitmap(stream)  
             End If  &lt;/b&gt;
           End If  
         End If  
         dr.Close()  
         cmd.Connection.Close()  
       End Using  
     End Using  
     Return logo  
   End Function  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
The example code takes the first record from the database table (tblPraktijk), checks if the &quot;FactuurHeader&quot; isn&#39;t null and returns a bitmap object. When the record does not exist (empty table) or it&#39;s image column is empty, a default (empty) bitmap is returned (first line in the method)&lt;br /&gt;
&lt;br /&gt;
When writing to the column the process is reversed by creating a byte array from your bitmap. I use two static methods to do the conversion:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;   &#39;&#39;&#39; &amp;lt;summary&amp;gt;  
   &#39;&#39;&#39; Convert Image to byte array 
   &#39;&#39;&#39; (From picturebox to database data)  
   &#39;&#39;&#39; &amp;lt;/summary&amp;gt;  
   &#39;&#39;&#39; &amp;lt;param name=&quot;img&quot;&amp;gt;Image to be converted&amp;lt;/param&amp;gt;  
   &#39;&#39;&#39; &amp;lt;returns&amp;gt;A byte array representing the image&amp;lt;/returns&amp;gt;  
   &#39;&#39;&#39; &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;  
   Public Shared Function ImageToBytes(img As Image) As Byte()  
     If img Is Nothing Then Return Nothing  
     Dim ms As New MemoryStream()  
     img.Save(ms, System.Drawing.Imaging.ImageFormat.Png)  &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&#39;&amp;lt;- Use correct image format!&lt;/b&gt;&lt;/span&gt;
     Return ms.ToArray()  
   End Function&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;&amp;nbsp;  &#39;&#39;&#39; &amp;lt;summary&amp;gt;  
   &#39;&#39;&#39; Convert byte atray to Image  
   &#39;&#39;&#39; (From database data to picturebox bitmap) 
   &#39;&#39;&#39; PicturBox1.Image = new Bitmap(myImage) 
   &#39;&#39;&#39; &amp;lt;/summary&amp;gt;  
   &#39;&#39;&#39; &amp;lt;param name=&quot;bytes&quot;&amp;gt;Byte arry to be converted&amp;lt;/param&amp;gt;  
   &#39;&#39;&#39; &amp;lt;returns&amp;gt;Image from the byte array&amp;lt;/returns&amp;gt;  
   &#39;&#39;&#39; &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;  
   Public Shared Function BytesToImage(bytes As Byte()) As Image  
     If bytes Is Nothing Then Return Nothing  
     Dim ms As New MemoryStream(bytes)  
     Dim img As Image = Image.FromStream(ms)  
     Return img  
   End Function  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Note: my default image format is PNG. Tweak the ImageToBytes function if you want a little flexibility in using different image formats...&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/5382596592540132849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2013/03/vbnet-sql-server-image-column-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/5382596592540132849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/5382596592540132849'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2013/03/vbnet-sql-server-image-column-to.html' title='VB.Net: SQL Server Image column to PicturBox Bitmap'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEjGa64lmNvLlAlZrwXnyF0_BawqYrbNRHO_0L-QbXbDr5Uzo04TSnJEIbGHwHaOUFtd_DVbvdOkeoE9miaqgiJex4T35Xp2EG2m7ZuSGXTnIAGR5z-1yRjQ4aqTCj-NqFkAgh2ICg7F4ks/s72-c/table.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-4321703292715880417</id><published>2013-02-20T21:29:00.000-03:00</published><updated>2013-02-20T21:29:16.268-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><title type='text'>Multiple return types? Tuple!</title><content type='html'>&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoZoqxNHFjwKN5HSl8LWZM2lGQ7ww160cADBkuO9nWFGcGZLdh_xGAs8-wzT_16j_7Sdi_p3I_G57J8ezyMMt4khyphenhyphen5CV2Iaw2u0WWvXxTMewnaKWKxVuUj3sJB8biq7dokqtvLVR2ds_E/s1600/MathTuple.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;153&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoZoqxNHFjwKN5HSl8LWZM2lGQ7ww160cADBkuO9nWFGcGZLdh_xGAs8-wzT_16j_7Sdi_p3I_G57J8ezyMMt4khyphenhyphen5CV2Iaw2u0WWvXxTMewnaKWKxVuUj3sJB8biq7dokqtvLVR2ds_E/s200/MathTuple.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;mathematical tuple&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
When coding there&#39;s one rule I don&#39;t want to break (It&#39;s my own rule btw):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;Whenever a code block needs to be copied, it needs to be in a separate method.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Of course the disadvantage of this approach is that whenever you code a bug in this piece of code, it will surface wherever it&#39;s used in your application.&lt;br /&gt;
&lt;br /&gt;
However, this (in my opinion) outweighs the frustration of fixing the same bug on multiple locations again and again and again and...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My problem.&lt;/h4&gt;
&lt;br /&gt;
In general, when using this &#39;generic&#39; code, I settle for a single return value. A boolean result to indicate everything worked out fine (or not!) is enough. Sometimes I would like to have more return values then a single type. The most obvious options:&lt;br /&gt;
1 - Use a struct return value&lt;br /&gt;
2 - Use an object as return value&lt;br /&gt;
3 - Return a collection object (Dictionary, List, etc)&lt;br /&gt;
4 - Use ref parms...
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem solved?&lt;/h4&gt;
&lt;br /&gt;
(1) requires a definition. Typically the return struct is specific to the function it returns. I need to define each struct or create something generic...&lt;br /&gt;
(2) as (1) : definitions : I&#39;m a lazy programmer ;)&lt;br /&gt;
(3) when al return values are of the same type it&#39;s definitely an option, but when that&#39;s not the case...&lt;br /&gt;
(4) big function signature and the variables need to be declared &#39;upfront&#39; even though they may remain &#39;empty&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem solved!&lt;/h4&gt;
&lt;br /&gt;
You &lt;strong&gt;can&lt;/strong&gt; return a &lt;em&gt;mixed type collection&lt;/em&gt;! It&#39;s not dynamic, so you cannot add elements on the fly like a &#39;usual&#39; collection. Consider this (console example) code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;-ms-word-wrap: normal; color: black;&quot;&gt; using System;  
 using System.Collections.Generic;  
 using System.Linq;  
 using System.Text;  
 namespace ConsoleApplication1  
 {  
   class Program  
   {  
     static void Main(string[] args)  
     {  
       // the tuple for the result Item1: bool, Item2: String 
       Tuple&amp;lt;bool, String&amp;gt; result;  
       MyObject test = new MyObject();  

       result = test.TestMethod(new MyObject(true));  
       Console.WriteLine(&quot;test.TestMethod(new MyObject(true));&quot;);  
       Console.WriteLine(String.Format(&quot;succes:{0}\terr:{1}&quot;,result.Item1,result.Item2));  
       Console.ReadLine();  

       result = test.TestMethod(new MyObject(false));  
       Console.WriteLine(&quot;test.TestMethod(new MyObject(false));&quot;);  
       Console.WriteLine(String.Format(&quot;succes:{0}\terr:{1}&quot;,result.Item1,result.Item2));  
       Console.ReadLine();  
     }  
   }
  
   class MyObject  
   {  
     public bool BooleanProperty { get; set; }  
     public MyObject() : this(true) { }  
     public MyObject(bool succes)  
     {  
       BooleanProperty = succes;  
     }
  
     public Tuple&amp;lt;bool, String&amp;gt; TestMethod(MyObject obj)  
     {  
       bool succes = true;  
       String err = String.Empty;  
       try  
       {  
         if (!obj.BooleanProperty) throw new InvalidOperationException(&quot;Something went wrong!&quot;);  
       }  
       catch (Exception ex)  
       {  
         succes = false;  
         err = ex.Message;  
       }  
       return Tuple.Create&amp;lt;bool, String&amp;gt;(succes, err);  
     }  
   }  
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
You define the types in the Tuple declaration. Not just value types, any object can be added. You just need to keep the result Tuple &#39;in sync&#39; with the expected return Tuple. The elements are stored in Item1, Item2, etc. Visual Studio intellisence shows the types of these items :)&lt;br /&gt;
&lt;br /&gt;
Now we can return a &#39;mixed collection&#39; &#39;on the fly&#39; :)</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/4321703292715880417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2013/02/multiple-return-types-tuple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4321703292715880417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4321703292715880417'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2013/02/multiple-return-types-tuple.html' title='Multiple return types? Tuple!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEgoZoqxNHFjwKN5HSl8LWZM2lGQ7ww160cADBkuO9nWFGcGZLdh_xGAs8-wzT_16j_7Sdi_p3I_G57J8ezyMMt4khyphenhyphen5CV2Iaw2u0WWvXxTMewnaKWKxVuUj3sJB8biq7dokqtvLVR2ds_E/s72-c/MathTuple.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-4031010937931623630</id><published>2012-10-18T09:01:00.000-03:00</published><updated>2012-10-18T09:01:27.633-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="WinForms"/><title type='text'>Transparent picturebox overlay in winforms</title><content type='html'>&lt;br /&gt;
I stumbled into an annoying problem when doing some graphics coding in a windows forms environment. The task seemed rather simple: Have a panel with a background image, drag images -in my case as listview items- onto that panel where a picturebox is shown to display the dragged image. When done, merge the picturebox images with the background to store the final picture as a single image.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My problem&lt;/h4&gt;
&lt;br /&gt;
When I drag an image (listview item) onto the panel a picturebox is created at the dragged location and the image is displayed. However, troubles arise when two pictureboxes overlap. Here&#39;s the catch: Setting transparency on your picturebox will make the background reflect &lt;u&gt;the picturebox control background&lt;/u&gt;! &lt;br /&gt;
So the result lookst like this:&lt;br /&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/AVvXsEghFg2C4GEX4Bg-Pap1_LwIXV0jK1IP0-od_VnxxqsI5Nd4D55r4rkWWGXByF8XvAbCyDiwVFA9bXAdFJT1RxkuDlPPCjokLZAHsxX9nkfonZUPhvxVf3qZQDAwNw6517tHpHI2C_KDJbk/s1600/default.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/AVvXsEghFg2C4GEX4Bg-Pap1_LwIXV0jK1IP0-od_VnxxqsI5Nd4D55r4rkWWGXByF8XvAbCyDiwVFA9bXAdFJT1RxkuDlPPCjokLZAHsxX9nkfonZUPhvxVf3qZQDAwNw6517tHpHI2C_KDJbk/s1600/default.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(I colored the second picturebox transparent area a little &#39;red-ish&#39; to show the problem!)&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem Solved?&lt;/h4&gt;
&lt;br /&gt;
I did some research on the net, but to no avail. So, I improvised:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;We know the picturebox transparent area will reflect the picturebox parent image/foreground&lt;/li&gt;
&lt;li&gt;I do need the complete picture anyway&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;There&#39;s no &quot;free painting&quot; involved, just &#39;reorganizing&#39; pictures&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Speed is not an issue, since by my (educated) guess, in my app there will be dragged less than well... lets say 50 images to the panel.&lt;/li&gt;
&lt;li&gt;Considering point 4, I just might &#39;get away&#39; with creating the final picture every time a picturebox is created/dragged/transformed...&lt;/li&gt;
&lt;li&gt;Control tags can contain Objects (&lt;i&gt;other controls!&lt;/i&gt;) &lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
&amp;nbsp;Problem solved!&lt;/h4&gt;
&lt;br /&gt;
Now consider this layout:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;A panel containing the background image (background)&lt;/li&gt;
&lt;li&gt;A Panel containing the imaged where background and picturebox images are merged (canvas) &lt;i&gt;and the parent&lt;/i&gt; of my pictureboxes&lt;/li&gt;
&lt;li&gt;The pictureboxes dragged onto the canvas&lt;/li&gt;
&lt;/ol&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/AVvXsEi_04gx6dttxPEnH7r27a9aNFiEt7Lcx3YbrcfevG-3bQ8nJwtCCoqc_tepYhm1oBWWwo15d4EPBioqBtpDJ_HdliDeohVP-CioSa2mEo5JDy14LWZXDu7fqb_K-iKm3qD5TLpLVYytpSM/s1600/layers.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_04gx6dttxPEnH7r27a9aNFiEt7Lcx3YbrcfevG-3bQ8nJwtCCoqc_tepYhm1oBWWwo15d4EPBioqBtpDJ_HdliDeohVP-CioSa2mEo5JDy14LWZXDu7fqb_K-iKm3qD5TLpLVYytpSM/s320/layers.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The trick now is to &#39;reconstruct&#39; the panel canvas background image every tima a picturebox is changed/added.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;We first create the background panel with the (clean) background image (pnlBackground).&lt;/li&gt;
&lt;li&gt;Next we create the canvas panel where pnlCanvas.Tag = pnlBackground. &lt;i&gt;The canvas is a child control of the background!&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Every time a new picturebox is added, the picturbox.Tag = pnlBackground. &lt;i&gt;The pictureboxes are children of the canvas! &lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
Do you see where I&#39;m going here?&lt;br /&gt;
Now on every event changing the pictureboxes on the canvas panel we call a function to reconstruct the canvas panel background image. Events like dragdrop on the canvas panel (adding a new picturebox) and events of the picturebox itself (dragging, rotating, etc)&lt;br /&gt;
&lt;br /&gt;
The merging function should accept a picturebox and a panel (overload it). When called with a picturebox we have:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Panel pnlCanvas = sender.Tag as Panel (sender == picturebox)&lt;br /&gt;
Panel pnlBackground = pnlCanvas.Tag as Panel&lt;/span&gt;&lt;br /&gt;
Now, take the pnlBackground image and &lt;i&gt;merge each picturebox image&lt;/i&gt; with it. The resulting image is your new pnlCanvas image.&lt;br /&gt;
&lt;br /&gt;
The end result will look like this:&lt;br /&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/AVvXsEhdVONsL-DAPiY1CnEpIm2YD2-aWuFCg76s9qLDfUFXdsXTCYexk0MPaeOjhycqRiSud9fFxUtNWnfB24rq7MuNZYoLAupF6kape9np4zJdIYpkkeai4oK-Y-iSar0jET_fUFe95VysDh0/s1600/desired.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/AVvXsEhdVONsL-DAPiY1CnEpIm2YD2-aWuFCg76s9qLDfUFXdsXTCYexk0MPaeOjhycqRiSud9fFxUtNWnfB24rq7MuNZYoLAupF6kape9np4zJdIYpkkeai4oK-Y-iSar0jET_fUFe95VysDh0/s1600/desired.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;Each picturebox transparent area reflects the parent control foreground, which is the merged picture of pnlCanvas! Since the pictureboxes are still there (overlaying the pnlCanvas) they are still available for editing by the user (dragging, rotating, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;There&#39;s lots of code available about merging images, so no code in this post. Just the basic idea on how I solved the problem. It might not be the best solution, but it works for me. As mentioned above: My &#39;canvas&#39; will not contain over 50 pictureboxes so speed is not an issue to me, but &#39;reconstructing&#39; (merging) the canvas picture will cost you...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/4031010937931623630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/10/transparent-picturebox-overlay-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4031010937931623630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4031010937931623630'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/10/transparent-picturebox-overlay-in.html' title='Transparent picturebox overlay in winforms'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEghFg2C4GEX4Bg-Pap1_LwIXV0jK1IP0-od_VnxxqsI5Nd4D55r4rkWWGXByF8XvAbCyDiwVFA9bXAdFJT1RxkuDlPPCjokLZAHsxX9nkfonZUPhvxVf3qZQDAwNw6517tHpHI2C_KDJbk/s72-c/default.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-4535652470727289302</id><published>2012-10-11T09:27:00.000-03:00</published><updated>2012-10-11T09:39:34.440-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="WinForms"/><title type='text'>Custom Cursor Hotspot - HowTo...</title><content type='html'>When I recently implemented some drag and drop functionality I wanted to create a nice &quot;drag cursor&quot;. A little different from the default. A quick &quot;&lt;a href=&quot;http://www.google.com/#sclient=psy-ab&amp;amp;hl=en&amp;amp;site=&amp;amp;source=hp&amp;amp;q=vb.net+C%23+custom%2C+mouse+cursor&amp;amp;oq=vb.net+C%23+custom%2C+mouse+cursor&amp;amp;gs_l=hp.3...4271.4271.0.4990.1.1.0.0.0.0.169.169.0j1.1.0.les%3B..0.0...1c.1.GMw91gWgfGw&amp;amp;pbx=1&amp;amp;bav=on.2,or.r_gc.r_pw.&amp;amp;fp=cb94b05c1cb056d5&amp;amp;bpcl=35243188&amp;amp;biw=1082&amp;amp;bih=575&quot; target=&quot;_blank&quot;&gt;Google&lt;/a&gt;&quot; showed me how to use a bitmap as a cursor.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My Problem&lt;/h4&gt;
&lt;br /&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/AVvXsEiF6Hy0Y2t08KtqhMzNiqsGaYDekF5JX4nzOHp8yk58aNp8is-a6c06LyFx_nO08CPEnbe_hLsBtbKRoplOOwm93TK7fq_Yw_6OQkNWA-8NL-OlDBM3Tn-KYoIkMBj8i-wR9scmnbwXeVk/s1600/Hotspot.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF6Hy0Y2t08KtqhMzNiqsGaYDekF5JX4nzOHp8yk58aNp8is-a6c06LyFx_nO08CPEnbe_hLsBtbKRoplOOwm93TK7fq_Yw_6OQkNWA-8NL-OlDBM3Tn-KYoIkMBj8i-wR9scmnbwXeVk/s1600/Hotspot.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
When creating a cursor from a bitmap the new cursor hotspot is the center point of that cursor image.&lt;br /&gt;
&lt;br /&gt;
Though I had a nice cursor now, using it posed a challenge for my users. People -rightfully- assume the &quot;fingertip&quot;  to be the point where they are pointing at not the center of their cursor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem solved?! &lt;/h4&gt;
Another Google search brought me the solution. To create my custom cursor (assuming the image is one of my resources) I had this code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Cursor.Current = New Cursor(My.Resources.addCursor.GetHicon())  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
To create a custom cursor &lt;u&gt;with a custom hotspot&lt;/u&gt; I changed it to:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Cursor.Current = FormHelper.CreateCursor(My.Resources.addCursor, New Point(5, 5))  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
The voodoo happens in the CreateCursor -static- method. Though you&#39;re probably not interested, I copied the source anyway:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;#Region &quot;Create Custom Cursor&quot; 
  
   Private Structure IconInfo  
     Public fIcon As Boolean  
     Public xHotspot As Int32  
     Public yHotspot As Int32  
     Public hbmMask As IntPtr  
     Public hbmColor As IntPtr  
   End Structure  

   &amp;lt;DllImport(&quot;user32.dll&quot;, EntryPoint:=&quot;CreateIconIndirect&quot;)&amp;gt; _  
   Private Shared Function CreateIconIndirect(ByVal iconInfo As IntPtr) As IntPtr  
   End Function  

   &amp;lt;DllImport(&quot;user32.dll&quot;, CharSet:=CharSet.Auto)&amp;gt; _  
   Public Shared Function DestroyIcon(ByVal handle As IntPtr) As Boolean  
   End Function  

   &amp;lt;DllImport(&quot;gdi32.dll&quot;)&amp;gt; _  
   Public Shared Function DeleteObject(ByVal hObject As IntPtr) As Boolean  
   End Function  

   &#39;&#39;&#39; &amp;lt;summary&amp;gt;  
   &#39;&#39;&#39; Create a custom winforms cursor with a designated hotspot  
   &#39;&#39;&#39; &amp;lt;/summary&amp;gt;  
   &#39;&#39;&#39; &amp;lt;param name=&quot;bmp&quot;&amp;gt;Image to be used as cursor&amp;lt;/param&amp;gt;  
   &#39;&#39;&#39; &amp;lt;param name=&quot;hotspot&quot;&amp;gt;Hotspot location of the cursor&amp;lt;/param&amp;gt;  
   &#39;&#39;&#39; &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;  
   &#39;&#39;&#39; &amp;lt;remarks&amp;gt;  
   &#39;&#39;&#39; Requires imports:  
   &#39;&#39;&#39; Imports System.Drawing  
   &#39;&#39;&#39; Imports System.Runtime.InteropServices  
   &#39;&#39;&#39; Imports System.Windows.Forms  
   &#39;&#39;&#39;&amp;lt;/remarks&amp;gt;  
   Public Shared Function CreateCursor(ByVal bmp As Bitmap, ByVal hotspot As Point) As Cursor  
     &#39;Setup the Cursors IconInfo  
     Dim tmp As New IconInfo  
     tmp.xHotspot = hotspot.X  
     tmp.yHotspot = hotspot.Y  
     tmp.fIcon = False  
     tmp.hbmMask = bmp.GetHbitmap()  
     tmp.hbmColor = bmp.GetHbitmap()  
     &#39;Create the Pointer for the Cursor Icon  
     Dim pnt As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(tmp))  
     Marshal.StructureToPtr(tmp, pnt, True)  
     Dim curPtr As IntPtr = CreateIconIndirect(pnt)  
     &#39;Clean Up  
     DestroyIcon(pnt)  
     DeleteObject(tmp.hbmMask)  
     DeleteObject(tmp.hbmColor)  
     Return New Cursor(curPtr)  
   End Function  

#End Region  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Don&#39;t forget the required imports! (In case you it did interest you)</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/4535652470727289302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/10/custom-cursor-hotspot-howto.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4535652470727289302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/4535652470727289302'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/10/custom-cursor-hotspot-howto.html' title='Custom Cursor Hotspot - HowTo...'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEiF6Hy0Y2t08KtqhMzNiqsGaYDekF5JX4nzOHp8yk58aNp8is-a6c06LyFx_nO08CPEnbe_hLsBtbKRoplOOwm93TK7fq_Yw_6OQkNWA-8NL-OlDBM3Tn-KYoIkMBj8i-wR9scmnbwXeVk/s72-c/Hotspot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-1356595940458955424</id><published>2012-08-27T08:26:00.000-03:00</published><updated>2012-08-27T08:30:18.861-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><title type='text'>Named pipes in .Net</title><content type='html'>&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/AVvXsEjWFJOMdEyM33LAI7PAC2Z4f3pvtA1WAsd-Vf6GlV-JRILc_RiLeKDydJYz-lr35AymKVuqWS4ArhbQfRiEnjUqTO5u1-jt108yTzMFfeJ1dHHg-wtta7pUO7_W4cCFyxKTRhBwyyjv6Fw/s1600/infobox.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWFJOMdEyM33LAI7PAC2Z4f3pvtA1WAsd-Vf6GlV-JRILc_RiLeKDydJYz-lr35AymKVuqWS4ArhbQfRiEnjUqTO5u1-jt108yTzMFfeJ1dHHg-wtta7pUO7_W4cCFyxKTRhBwyyjv6Fw/s200/infobox.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Recently I did a job involving sending SMS messages from a web service. The message application app is SMS Studio, from &lt;a href=&quot;http://www.codesegment.com/download.htm&quot; target=&quot;_blank&quot;&gt;CodeSegment&lt;/a&gt;. This application is used for some time by our client and in the past we&#39;ve only used VB Script to interface with it.&lt;br /&gt;
Using VB Script, the easy way to send an SMS was to make SMS Studio create a named pipe to receive incoming messages and &#39;place&#39; the SMS content in that pipe by our script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My problem&lt;/h4&gt;
Seems straight forward. In vb script we create an fso object and write to the pipe. Should be as easy -if not easier- in .Net right? Wrong! The Filestream object in System.IO does not allow your to write to a &#39;device&#39;. Anything named &quot;\\.\[device]\[name]&quot; is not allowed. Apparently &quot;pipe&quot; is considered a device... &quot;\\.\pipe\SendSMS&quot; dit not work..&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem Solved?!&lt;/h4&gt;
Making a long story short: What I was looking for was here: &lt;i&gt;System.IO.Pipes&lt;/i&gt;. It is available as of&amp;nbsp; framework 3.5.&lt;br /&gt;
&lt;br /&gt;
This is how we did it in vb script:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Set fso = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)  
 Set pipe = fso.CreateTextFile(&quot;\\.\pipe\SendSMS&quot;)  
 pipe.Write(msgText)  
 pipe.Close   
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
And the .Net way:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Try  
    Using pipe As New NamedPipeClientStream(&quot;.&quot;, &quot;SendSMS&quot;, PipeDirection.Out, PipeOptions.Asynchronous)  
      pipe.Connect(2000)  
      Using sw As New StreamWriter(pipe)  
        sw.AutoFlush = True  
        sw.Write(msgText)  
      End Using  
    End Using  
 Catch ex As Exception  
    Messagebox.Show(ex.Message &amp;amp; Environment.Newline &amp;amp; &quot;SMS Studio offline?&quot;, &quot;SMS not send&quot;)  
 End Try  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Notice that the pipe name in .Net is only the name &quot;SendSMS&quot;, not the &#39;full&#39; name (&quot;\\.\pipe\SendSMS&quot;) like in vb script! Also we use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.io.pipes%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;NamedPipeClientStream&lt;/i&gt;&lt;/a&gt;, because we &#39;connect&#39; to an existing pipe. It turns out to be this simple.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/1356595940458955424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/08/named-pipes-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1356595940458955424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1356595940458955424'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/08/named-pipes-in-net.html' title='Named pipes in .Net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEjWFJOMdEyM33LAI7PAC2Z4f3pvtA1WAsd-Vf6GlV-JRILc_RiLeKDydJYz-lr35AymKVuqWS4ArhbQfRiEnjUqTO5u1-jt108yTzMFfeJ1dHHg-wtta7pUO7_W4cCFyxKTRhBwyyjv6Fw/s72-c/infobox.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-7909945454665456282</id><published>2012-08-01T08:49:00.001-03:00</published><updated>2012-08-01T08:50:49.946-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Telerik"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2010"/><title type='text'>Visual Studio; The Document outline window</title><content type='html'>I really love &lt;a href=&quot;http://www.telerik.com/&quot; target=&quot;_blank&quot;&gt;Telerik &lt;/a&gt;controls especially in a winforms and asp.net environment. In a windows form solution it gives you this visual edge where your apps just looks a little more professional and appealing. RadDock is by far my most favorite control, closely followed by RadCommandBar.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi32nyukEOFMRASxEgRHowA9w_Pwc1O2kratDvsU4wMvlezyucGzoXMJBBEaSrTo4C4kV8MHPLQmgevUop8k_lzatYQMAmmQ39yVtvleGNPcwtEoCp9rq3d1PBTBhUAXTw_8kn3kILHG5A/s1600/FormWrong.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi32nyukEOFMRASxEgRHowA9w_Pwc1O2kratDvsU4wMvlezyucGzoXMJBBEaSrTo4C4kV8MHPLQmgevUop8k_lzatYQMAmmQ39yVtvleGNPcwtEoCp9rq3d1PBTBhUAXTw_8kn3kILHG5A/s200/FormWrong.png&quot; width=&quot;193&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;
My problem&lt;/h4&gt;
&lt;br /&gt;
Okay, so Telerik did a great job with those winform controls. But the problem is the order I drag my controls from the toolbox to my form. Usually I add a RadCommandBar first docking it to the top of the form, followed by a RadDock docking the form. Occasionally I first add the dock then the bar, resulting in the bar overlaying the dock.&lt;br /&gt;
&lt;br /&gt;
Not the desired end result...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem solved?&lt;/h4&gt;
&lt;br /&gt;
Sort of... Usually I went to the forms designer code behind and changed the Me.Controls.Add order.&lt;br /&gt;
&lt;br /&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/AVvXsEjscS_YyZzxc5gA3LM3qeQ5SS8rq4Kvb3U-58YLmUpHThd3nz46UraNO0Id35OtPB43H_LaldhVzmYOIZdl7BXAabJvkwBNW0NdEohdDE-Dq264sBjsEjhW5Fp2EIp0p47sY1e_qfAcZ4E/s1600/DesignerVb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjscS_YyZzxc5gA3LM3qeQ5SS8rq4Kvb3U-58YLmUpHThd3nz46UraNO0Id35OtPB43H_LaldhVzmYOIZdl7BXAabJvkwBNW0NdEohdDE-Dq264sBjsEjhW5Fp2EIp0p47sY1e_qfAcZ4E/s640/DesignerVb.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Problem Solved!&lt;/h4&gt;
&lt;br /&gt;
But by chance I stumbled into a Visual Studio feature which is far more easy: The document outline window! A -almost &quot;hidden&quot;- window showing all controls on your form. Rearranging controls is reduced to drag&#39;n&#39;drop and clicking arrows. No more need to edit designer code behind.&lt;br /&gt;
&lt;br /&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/AVvXsEh6u20PHbgQdLQD7VZTsqLvIx85Pyx2YrvpIVDgHlvL94-JxCLHaf7TBadgNO71qh_vtVBTkGmA6VCTaf6-IQFPPw50mXlgDAjH5jTbx25aBHuyP9gsmm8T1pbEYw8T5xioGkCkInMkGJg/s1600/DocOutline2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6u20PHbgQdLQD7VZTsqLvIx85Pyx2YrvpIVDgHlvL94-JxCLHaf7TBadgNO71qh_vtVBTkGmA6VCTaf6-IQFPPw50mXlgDAjH5jTbx25aBHuyP9gsmm8T1pbEYw8T5xioGkCkInMkGJg/s640/DocOutline2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
To show this window from the main menu, select View -&amp;gt; Other Windows -&amp;gt; Document Outline&lt;br /&gt;
&lt;br /&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/AVvXsEg_21mVWk7343wf3hu7ngfm3_jRcW7aEy-rlvPfzhhxXUaX7T57CcoMAiUsGxHE9Gj-Tu4TfbpVFW4fpqcaHHVN_6Jn12XYZW8k89Bsn2Nf_cEKlulexM6xBq5nB0o1z-S29JLcVwgCBzM/s1600/DocOutline.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_21mVWk7343wf3hu7ngfm3_jRcW7aEy-rlvPfzhhxXUaX7T57CcoMAiUsGxHE9Gj-Tu4TfbpVFW4fpqcaHHVN_6Jn12XYZW8k89Bsn2Nf_cEKlulexM6xBq5nB0o1z-S29JLcVwgCBzM/s400/DocOutline.png&quot; width=&quot;343&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/7909945454665456282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/08/visual-studio-document-outline-window.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/7909945454665456282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/7909945454665456282'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/08/visual-studio-document-outline-window.html' title='Visual Studio; The Document outline window'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEi32nyukEOFMRASxEgRHowA9w_Pwc1O2kratDvsU4wMvlezyucGzoXMJBBEaSrTo4C4kV8MHPLQmgevUop8k_lzatYQMAmmQ39yVtvleGNPcwtEoCp9rq3d1PBTBhUAXTw_8kn3kILHG5A/s72-c/FormWrong.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-1619133048781361200</id><published>2012-07-25T16:03:00.000-03:00</published><updated>2012-07-25T16:09:28.018-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>ASP.Net: Wait for postback response</title><content type='html'>&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/AVvXsEiRdb61kkA0c0agSnSCrxv_p0DjLacORnSFdQ-F0-RNfTnLBsoe8u78Z5gLMuy__PrenqwMimlNV2crmSoyhdGOmcqRtUoix6f4kBCtNBBX-elibR_jwb4X3pfL4qQQD7aaVHy_4zCIsrw/s1600/asp.net.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;61&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRdb61kkA0c0agSnSCrxv_p0DjLacORnSFdQ-F0-RNfTnLBsoe8u78Z5gLMuy__PrenqwMimlNV2crmSoyhdGOmcqRtUoix6f4kBCtNBBX-elibR_jwb4X3pfL4qQQD7aaVHy_4zCIsrw/s200/asp.net.gif&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
We have a ASP.Net application where some postbacks might take some time to be handled by the server. 
When the user triggers a postback, we want the client to be forced to wait until the postback is handled by the server. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
My Problem&lt;/h4&gt;
I want this mechanism to kick in on every page of the site, though some pages do not realy require it.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

















Problem solved? &lt;/h4&gt;
&lt;h4&gt;





&lt;/h4&gt;
Obviously you end up in the master page, but as in animal farm: &quot;All pages are equal, but some pages are more equal then others&quot;. I want certain pages to handle the postback slightly different from the default...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;





Problem Solved!&lt;/h4&gt;
The solution contains 3 elements: html, css and a little javascript. It&#39;s the javascript that helped me out.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red; font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;color: #cc0000; font-size: large;&quot;&gt;html:&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;     &amp;lt;div id=&quot;mainContent&quot;&amp;gt;  
       &amp;lt;div class=&quot;loadinggs&quot; id=&quot;loadingoverlay&quot;&amp;gt;  
         &amp;lt;div class=&quot;loadingmsg&quot;&amp;gt;  
           &amp;lt;img src=&quot;../../Images/ajax-loader.gif&quot; align=&quot;middle&quot; alt=&quot;busy&quot; /&amp;gt;  
           Bezig met verwerken...  
         &amp;lt;/div&amp;gt;  
       &amp;lt;/div&amp;gt;  
       &amp;lt;asp:ContentPlaceHolder ID=&quot;MainContent&quot; runat=&quot;server&quot; /&amp;gt;  
     &amp;lt;/div&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
The place of the code depends on what part you want to block. The example code &#39;blocks&#39; the main content, leaving the menu (in another placeholder) accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000; font-size: large;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;CSS:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; .loadinggs  
 {  
   position:fixed;  
   width:100%;  
   height:100%;  
   background:rgba(255, 255, 255, 0.5);  
   z-index:1000000000000;  
   display:none;  
   }  
 .loadingmsg  
 {  
   position:absolute;  
   top:30%;  
   left:50%;  
   background:#fff;  
   border:2px solid #196DC1;  
   padding:5px;  
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;i&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;HTML &amp;amp; CSS by Gio! (thanks again!)&lt;/span&gt;&lt;/i&gt; The CSS is primarily IE9 (as by my requirement), but you can easily tweak it to support other browsers aswell.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000; font-size: large;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Javascript &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;%--  
     Initializing the Page PageRequestManager, handling 4 key events:  
     1 - BeginRequest - Start of a postback  
     2 - Endrequest  - Server response on postback event  
     3 - PageLoading - ... (self explainatory I guess)  
     4 - PageLoaded  -  
     By default on each page a animated loading img is shown. But certain pages have additional functionality.  
     In appl_init we check if additional functions were provided for each event. If not the default behaviour is applied.  
 --%&amp;gt;  
 &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;  
   var pgRegMgr;  
   // add an event handler to &#39;pageload&#39;  
   Sys.Application.add_init(appl_init);  
   /*  
   The PageRequestManager contains postback information.  
   When this page initializes, we can add handlers to this manager to catch events.  
   &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;NOTE: This javascript code need te be placed AFTER the &amp;lt;/body&amp;gt; tag !!!!&lt;/span&gt;&lt;/b&gt;  
   */  
   function appl_init() {  
     // if we do not have the PageRequestManager instance, get it AND add the handler(s)  
     if (pgRegMgr == null) {  
       if (Sys != null) {  
         if (Sys.WebForms != null) {  
           pgRegMgr = Sys.WebForms.PageRequestManager.getInstance();  
           // check for specific event handlers, if not found use the default  
           if (window.pageBeginRequest) { pgRegMgr.add_beginRequest(pageBeginRequest); } else { pgRegMgr.add_beginRequest(BeginHandler); }  
           if (window.pageEndRequest) { pgRegMgr.add_endRequest(pageEndRequest); } else { pgRegMgr.add_endRequest(EndHandler); }  
           if (window.pageLoading) { pgRegMgr.add_pageLoading(pageLoading); } else { pgRegMgr.add_pageLoading(BeginHandler); }  
           if (window.pageLoaded) { pgRegMgr.add_pageLoaded(pageLoaded); } else { pgRegMgr.add_pageLoading(EndHandler); }  
         }  
       }  
     }  
   }  
   /*  
   Default pageBeginRequest and pageLoading behaviour.  
   */  
   function BeginHandler() {  
     document.getElementById(&#39;loadingoverlay&#39;).style.display = &#39;block&#39;;  
   }  
   /*  
   Default pageEndRequest and pageLoaded behaviour.  
   */  
   function EndHandler() {  
     document.getElementById(&#39;loadingoverlay&#39;).style.display = &#39;none&#39;;  
   }  
 &amp;lt;/script&amp;gt;  
 &amp;lt;asp:ContentPlaceHolder ID=&quot;AfterBody_AddedHandlers&quot; runat=&quot;server&quot; /&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now on each postback of a control the content part of the screen is &#39;locked&#39; until the server responds. The script supports the usage of&amp;nbsp; a specific handler on the content page hosted by the master. Just add the handlers in the &amp;lt;asp:Content&amp;gt; tag and do enclose them with &amp;lt;script&amp;gt;&amp;lt;/script&amp;gt; tags. And -if applicable- don&#39;t forget to hide the loading message...&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;asp:Content ID=&quot;Content2&quot; ContentPlaceHolderID=&quot;AfterBody_AddedHandlers&quot; runat=&quot;Server&quot;&amp;gt;  
   &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;  
     /*  
     When a postback was handled by the server (Code behind was executed...)  
     we want to check if a specific control was causing the postback...  
     */  
     function pageEndRequest() {  
       //do specific page stuff...  
     }  
     /*  
     Catch the pageLoaded event.  
     */  
     function pageLoaded() {  
      //eg. call a specific function like a body onload  
       UpdateTotals();  
       document.getElementById(&#39;loadingoverlay&#39;).style.display = &#39;none&#39;;  
     }  
   &amp;lt;/script&amp;gt;  
 &amp;lt;/asp:Content&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/1619133048781361200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/07/aspnet-wait-for-postback-response.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1619133048781361200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/1619133048781361200'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/07/aspnet-wait-for-postback-response.html' title='ASP.Net: Wait for postback response'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEiRdb61kkA0c0agSnSCrxv_p0DjLacORnSFdQ-F0-RNfTnLBsoe8u78Z5gLMuy__PrenqwMimlNV2crmSoyhdGOmcqRtUoix6f4kBCtNBBX-elibR_jwb4X3pfL4qQQD7aaVHy_4zCIsrw/s72-c/asp.net.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-5170110848173781595</id><published>2012-07-23T15:12:00.000-03:00</published><updated>2012-07-23T15:12:25.365-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Outlook"/><category scheme="http://www.blogger.com/atom/ns#" term="Sync"/><title type='text'>Sync Outlook with Android!</title><content type='html'>Looking for free software to synchronize your outlook data with your Android device? &lt;br /&gt;
After searching the web with &lt;a href=&quot;https://www.google.com/search?q=outlook+android&quot; target=&quot;_blank&quot;&gt;google&lt;/a&gt; &lt;a href=&quot;https://www.google.com/search?q=android+sync+outlook&quot; target=&quot;_blank&quot;&gt;again&lt;/a&gt; and &lt;a href=&quot;https://www.google.com/search?q=outlook+sync+android&quot; target=&quot;_blank&quot;&gt;again&lt;/a&gt; I found a solution. They say the best things in life are free, but your should really consider a donation to these developers!&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://www.fjsoft.at/en/&quot; target=&quot;_blank&quot;&gt;MyPhoneExplorer&lt;/a&gt; &lt;/h4&gt;
&lt;br/&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.fjsoft.at/en/&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-NmvFtxJs5EvLUVbGBvTPvJqOH8kyXCdnYiXbJeUQB97OwX9Eki-SkwhEInXl1t6o_Xs27pzMBV_cjkYloDVNjusOUpvDBc9eEejwYwnio2fUdKIWxmbzBCJDS7o-Gb8banb_sCrNhyphenhyphenY/s400/MyPhoneExplorer.png&quot; width=&quot;393&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This is what you are looking for! Fully functional, not a trial version. And do donate, it&#39;s worth it!&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/5170110848173781595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/07/sync-outlook-with-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/5170110848173781595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/5170110848173781595'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/07/sync-outlook-with-android.html' title='Sync Outlook with Android!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEi-NmvFtxJs5EvLUVbGBvTPvJqOH8kyXCdnYiXbJeUQB97OwX9Eki-SkwhEInXl1t6o_Xs27pzMBV_cjkYloDVNjusOUpvDBc9eEejwYwnio2fUdKIWxmbzBCJDS7o-Gb8banb_sCrNhyphenhyphenY/s72-c/MyPhoneExplorer.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-7928371783428769518</id><published>2012-07-20T14:24:00.002-03:00</published><updated>2012-07-20T14:24:51.494-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Setup"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="vs2010"/><title type='text'>Setup and Deployment:  A Windows service</title><content type='html'>&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPlyU7mr6uozUMfi_yHRi27bE8qNW4RiTMCIOAYwTlbyKfpVTjOUz9rhTiYGvlSJsnLr6bmK0-FZ2Iq0gFo_xgaNJHsW2xilX6IjftUTz4IC-UtGBd2waE_qt1XxTn4hyvlQ6T9dGOEuw/s1600/gear.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPlyU7mr6uozUMfi_yHRi27bE8qNW4RiTMCIOAYwTlbyKfpVTjOUz9rhTiYGvlSJsnLr6bmK0-FZ2Iq0gFo_xgaNJHsW2xilX6IjftUTz4IC-UtGBd2waE_qt1XxTn4hyvlQ6T9dGOEuw/s1600/gear.png&quot; /&gt;&lt;/a&gt;So I made myself a nice Windows Service in Visual Studio 2010 for some background work. As numerous sites point out, I did not forget to add a &quot;project installer&quot; -which seems to be required- by right clicking on the Service Design view and selecting &quot;add installer&quot; from the popup. Set some properties and we&#39;re good to go. That was the easy part as it turned out. &lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;

My Problem&lt;/h4&gt;
&lt;br /&gt;
Now it needed to be installed on client machines so I added a new 
project to my solution: Other Project Types -&amp;gt; Setup and Deployment 
-&amp;gt; Visual Studio Installer. &quot;Been there, done that&quot; I would think...&lt;br /&gt;
&lt;br /&gt;
I added the &quot;Primary output from myService (active)&quot; to the file system. Just as I did countless times, for countless other apps. Organized the install information like name, company, version and so on and so forth... The usual stuff really. When build, indeed the project generates the &quot;.msi&quot; and &quot;setup.exe&quot; as expected. &lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;

Problem solved?&lt;/h4&gt;
&lt;br /&gt;
Right click &quot;setup.exe&quot; from my release folder of the setup project. &quot;Run as administrator&quot; to be absolutly sure the User Account Control doesn&#39;t bother me, and install! And -as expected- install ended with no problems. So cool, creating my own service... No let&#39;s see if this works...&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;[anxious on]&lt;/i&gt; Start button -&amp;gt; services.msc -&amp;gt; here&#39;s my list of services...&lt;i&gt;[anxious off]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Huh? Where is it? It did install,&lt;b&gt; it did&lt;/b&gt;! Look at the control panel -&amp;gt; Add remove software -&amp;gt; It&#39;s right there!&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;

Problem solved!&lt;/h4&gt;
&lt;br /&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/AVvXsEhJnEBNdnb05NtHEH-qCY1bgYyw-uzGfhjAi4MDgkxXLLAWua7oAwiwBmB-VB5KsSwo-JwbiDc4R4VJFYhPmsfmu7pz4YrWhxzYT7D8mWIdwL2wj_sN2dJbCc5-sc4f9Om133LOK8owOmQ/s1600/ServiceInstaller.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJnEBNdnb05NtHEH-qCY1bgYyw-uzGfhjAi4MDgkxXLLAWua7oAwiwBmB-VB5KsSwo-JwbiDc4R4VJFYhPmsfmu7pz4YrWhxzYT7D8mWIdwL2wj_sN2dJbCc5-sc4f9Om133LOK8owOmQ/s320/ServiceInstaller.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
When &lt;u&gt;installing a service&lt;/u&gt; -it turns out- we need some extra settings in the setup project.&lt;br /&gt;
&lt;br /&gt;
Right click the setup project and select &quot;Custom actions&quot; from the popup menu. Add the &lt;u&gt;primary output&lt;/u&gt; from your service to Install, Commit, Rollback and uninstall.&lt;br /&gt;
&lt;br /&gt;
Finally rebuild your setup -don&#39;t forget to uninstall your previous attempt- and install your new build. Now run &quot;services.msc&quot; and... &lt;br /&gt;&quot;&lt;b&gt;There it is!&lt;/b&gt;&quot; (to qoute the great Charlie Harper :)&lt;br /&gt;
&lt;br /&gt;Off course starting the service might still be a dissapointment, depending on your coding skills. But atleast it got installed!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/7928371783428769518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/07/setup-and-deployment-windows-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/7928371783428769518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/7928371783428769518'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/07/setup-and-deployment-windows-service.html' title='Setup and Deployment:  A Windows service'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEiPlyU7mr6uozUMfi_yHRi27bE8qNW4RiTMCIOAYwTlbyKfpVTjOUz9rhTiYGvlSJsnLr6bmK0-FZ2Iq0gFo_xgaNJHsW2xilX6IjftUTz4IC-UtGBd2waE_qt1XxTn4hyvlQ6T9dGOEuw/s72-c/gear.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-2765154536295612193</id><published>2012-07-13T21:03:00.000-03:00</published><updated>2012-07-13T23:06:20.216-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Access"/><category scheme="http://www.blogger.com/atom/ns#" term="Telerik"/><title type='text'>Generated objects, property exists? (or not!)</title><content type='html'>&lt;a href=&quot;http://www.telerik.com/&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi__qjOzROSlMRHxl03HQPUny69F7k8-tmALLC2x2Whwi7yZXzdBumUHNCsmulNFqJHOCgFDyonqHIV32oQpXE6Mvz6oV3kn_o8CDP9V766nBIcZ_k_Mj34VV2N9xPvo5sHeyhiTYM-otE/s1600/telerik.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
The &lt;a href=&quot;http://en.wikipedia.org/wiki/Object-relational_mapping&quot; target=&quot;_blank&quot;&gt;ORM &lt;/a&gt;of choice of my employer is &lt;a href=&quot;http://www.telerik.com/products/orm.aspx&quot; target=&quot;_blank&quot;&gt;Telerik Open Access&lt;/a&gt;. It supports both forward and reverse mapping. When doing &lt;a href=&quot;http://en.wikipedia.org/wiki/Scrum_%28development%29&quot; target=&quot;_blank&quot;&gt;SCRUM&lt;/a&gt; development, it gives us the flexibility to quickly add some database columns, tables, foreign key relations etc. in the database and then generate the business objects in our data layer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;








My problem&lt;/h4&gt;
In a particular project the customer opted for record tracking. Who -and when- created (e.g.) a person in the database, and who (when) had it changed.&lt;br /&gt;
The catch though:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;it&#39;s not required for all tables.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The creation / modification &lt;i&gt;user is only known in the software&lt;/i&gt; (no database trigger solution).&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h4&gt;








Problem solved?&lt;/h4&gt;
One part of the solution was to edit the &lt;a href=&quot;http://www.telerik.com/products/orm.aspx&quot; target=&quot;_blank&quot;&gt;Telerik Open Access&lt;/a&gt; class generation templates. In those templates we added a (default!) constructor. In the constructor we set the creator and creation date properties. Adding / implementing INotifyPropertyChanged handled the modification properties. The generation of the business classes was no problem, but compiling the project was another story...&lt;br /&gt;
Not every business class had the creation properties, so we faced &quot;some&quot; compiler errors.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;








Problem solved!&lt;/h4&gt;
Refelection saved the day. Instead of setting the property straight forward in the constructor:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; this._createUser=&quot;new creator&quot;;  
&lt;/code&gt;&lt;/pre&gt;
it&#39;s &#39;decorated&#39; with an if:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; if(!this.GetType().GetProperty(&quot;CreateUser&quot;) == null)  
 {  
   this.GetType().GetProperty(&quot;CreateUser&quot;).SetValue(this,&quot;new creator&quot;,null);  
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now we can (re-)generate the class model without the headache of modifying 70+ constructors for objects without tracking (or the need to add 40+ constructers&amp;nbsp; when not generated).</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/2765154536295612193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/07/generated-objects-property-exists-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/2765154536295612193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/2765154536295612193'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/07/generated-objects-property-exists-or.html' title='Generated objects, property exists? (or not!)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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/AVvXsEi__qjOzROSlMRHxl03HQPUny69F7k8-tmALLC2x2Whwi7yZXzdBumUHNCsmulNFqJHOCgFDyonqHIV32oQpXE6Mvz6oV3kn_o8CDP9V766nBIcZ_k_Mj34VV2N9xPvo5sHeyhiTYM-otE/s72-c/telerik.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1515491758030471438.post-6903719160737963367</id><published>2012-07-12T08:27:00.001-03:00</published><updated>2012-07-13T23:05:20.956-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Linked tables in SQL Server 2008 (R2)</title><content type='html'>&lt;h2&gt;



&lt;/h2&gt;
Usually Google is my friend, but looking for &lt;a href=&quot;https://www.google.com/#hl=en&amp;amp;safe=off&amp;amp;sclient=psy-ab&amp;amp;q=linked+table+sql+server+2008+r2&amp;amp;oq=linked+table+sql+server+2008+r2&amp;amp;gs_l=hp.3...289.2212.2.3255.3.3.0.0.0.0.498.859.0j2j4-1.3.0...0.0.MHPKmR9CzkA&amp;amp;pbx=1&amp;amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&amp;amp;fp=15f4f2ff325d4b5a&amp;amp;biw=1179&amp;amp;bih=735&quot; target=&quot;_blank&quot;&gt;SQL Linked tables&lt;/a&gt; gave me some frustration. Admittedly, I searched for the wrong thing...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;



My problem &lt;/h4&gt;
Consider 2 identical databases on 1 (SQL 2008) server. The data is -off course- different, however some tables need to be &#39;in sync&#39;. My initial thought was to make database one the lead database, storing the data. In database two I delete that particular table and create a linked table to database one. Just like one would do in MS Access...&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;



Problem solved?&lt;/h4&gt;
Hold that thought: &quot;Just like in access&quot;... Short version of the story: there are no linked tables in SQL Server!&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;



Problem solved!&lt;/h4&gt;
It turns out in SQL Server it&#39;s not &quot;linked tables&quot;, it&#39;s &lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;Synonyms&lt;/span&gt;!!!&lt;/i&gt; So when I did a search on&amp;nbsp;&lt;a href=&quot;https://www.google.com/#hl=en&amp;amp;safe=off&amp;amp;sclient=psy-ab&amp;amp;q=synonym%20sql%20server%202008%20r2&amp;amp;oq=syno%20sql%20server%202008%20r2&amp;amp;gs_l=hp.11.0.0i13i30.691067.691722.3.694066.4.4.0.0.0.3.946.2528.2-1j5-1j2.4.0...0.0.jRMFZKFLuIA&amp;amp;pbx=1&amp;amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&amp;amp;fp=15f4f2ff325d4b5a&amp;amp;biw=1179&amp;amp;bih=735&amp;amp;pf=p&amp;amp;pdl=300&quot; target=&quot;_blank&quot;&gt;Synonyms&lt;/a&gt; Google showed a wealth of information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some things I stumbled into when replacing the tables with synonyms:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;First remove all foreign keys related to tables which are being replaced by synonyms&lt;/li&gt;
&lt;li&gt;Then remove the primary keys of tables to be replaced&lt;/li&gt;
&lt;li&gt;Synonyms can not have FK constraints!&lt;/li&gt;
&lt;/ul&gt;
So&amp;nbsp; linking tables in SQL turns out to be as easy as: &lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRpD-wgNaAGDlYFX3YwU93T99DqvDAXJ6pXS3zfK2HPgElNTNpa5ghMxH6WxOlZWjCX-cm0Z7R8XYHHX9v2XR7EaI6oToe-Xr3TYP2fg8H9diSlGaPqyiL5bhUfrTVaR8X7uUBQmKU_Vb/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; DROP TABLE [dbo].[myTable]  
 CREATE SYNONYM [dbo].[myTable] FOR [TheOtherDatabase].[dbo].[myTable]  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lextendo.blogspot.com/feeds/6903719160737963367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lextendo.blogspot.com/2012/07/linked-tables-in-sql-server-2008-r2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/6903719160737963367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1515491758030471438/posts/default/6903719160737963367'/><link rel='alternate' type='text/html' href='http://lextendo.blogspot.com/2012/07/linked-tables-in-sql-server-2008-r2.html' title='Linked tables in SQL Server 2008 (R2)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04487652997927842425</uri><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>