<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>WebX</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/harryh/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/harryh/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:39:48 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SQL 2008 Remote connection checklist</title>
      <link>https://docs.microsoft.com/archive/blogs/harryh/sql-2008-remote-connection-checklist</link>
      <pubDate>Mon, 07 Mar 2011 22:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Harry.MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/harryh/2011/03/07/sql-2008-remote-connection-checklist/</guid>
      <description><![CDATA[I don't know why SQL document didn't put all pieces infomation together. Here is the full list to...]]></description>
      <content:encoded><![CDATA[<p>I don't know why SQL document didn't put all pieces infomation together. Here is the full list to check:</p>
<p>1. Ensure machineName\SqlInstanceName is correct</p>
<p>2. Open "Sql Server Configuration Manager", <br />&nbsp;&nbsp;&nbsp; under "SQL Server Services", ensure "SQL Server" and "SQL Server Browser" is running; <br />&nbsp;&nbsp;&nbsp; under "SQL Server Network Configuration"-&gt;"Protocols for server", ensure "Named Pipes" and "TCP/IP" are enable</p>
<p>3. Open SQL Server Management Studio, right click server-&gt;property, in the "Server Properties", go Connections<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check "Allow remote connections to this server" (Question: why this step would not enable the network protocols in step 2?)</p>
<p>4. Open Windows Firewall configuration, add two exceptions for Sql server (TCP 1433) and Sql browser (UDP 1434)</p>
<p>Detail: <a href="https://blogs.msdn.com/b/sql_protocols/archive/2006/09/30/sql-server-2005-remote-connectivity-issue-troubleshooting.aspx">https://blogs.msdn.com/b/sql_protocols/archive/2006/09/30/sql-server-2005-remote-connectivity-issue-troubleshooting.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Databind selected items across different pages in XAML</title>
      <link>https://docs.microsoft.com/archive/blogs/harryh/databind-selected-items-across-different-pages-in-xaml</link>
      <pubDate>Wed, 23 Jun 2010 17:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Harry.MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/harryh/2010/06/23/databind-selected-items-across-different-pages-in-xaml/</guid>
      <description><![CDATA[In my last post, I show how to databind selectedItems in a listbox in the same windows. This post I...]]></description>
      <content:encoded><![CDATA[<p>In my last post, I show how to databind selectedItems in a listbox in the same windows. This post I show how to databind selectedItem accross different pages.</p>
<p>When databinding data across different&nbsp; windows/pages/screens, we can't refer to the listbox directly, so we need a small help: DataStore.<br />The attached solution is a WPF Sketchflow solution. Inside&nbsp; \bindingScreen\bindingScreen\bindingScreenScreens , there are 2 screens, Screen1 has a listbox databound to a sample datasource, Screen2 has textblocks that display values of the selectedItem of the listbox in Screen1. Assuming there is a collection type of data, I used a SampleDataSource for demonstration.</p>
<p>First: --&nbsp;Create a dataStore (named SelectedItemData in this solution)&nbsp;from the datapane, add properties with matching names to the properties of the collection in SampleDataSource. Notices that datastore properties support only string, boolean and number data types.</p>
<p><span style="color: #000000;">On Screen1:<br /></span>To do that on Blend UI,&nbsp; drag SetDataStoreValueAction from Assets pane Behaviors to the listbox, on Properties pane, pick <strong><span style="color: #800000;">EventName </span></strong>to be "SelectionChanged", pick the <strong><span style="color: #800000;">Property </span></strong>name that need to be databound, select the "Advance options" menu besides <span style="color: #800000;"><strong>Value </strong><span style="color: #000000;">and select "Element property binding..", mouse point to the listbox then click, then select "SelectedItem"<br />Important: Then you have to edit the xaml of the SetDataStoreValueAction for the matching property name:<br />change: <span style="color: #ff6600;">Value="{Binding SelectedItem, ElementName=listBox1}"<br /></span>to:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366ff;"> <span style="color: #ff6600;">Value="{Binding SelectedItem<strong>.Property1</strong>, ElementName=listBox1}"</span></span>&nbsp;&nbsp;&nbsp;&nbsp; <br />Repeat the above steps for each databinding property</span></span></p>
<p><span style="color: #800000;"><span style="color: #000000;">To do that on code behind, you may add EventHandler to the listbox: <span style="color: #3366ff;">&nbsp;<span style="color: #ff6600;">SelectionChanged="SetProperty3"</span></span> <br /><span style="color: #3366ff;">private void SetProperty3(object sender, System.Windows.Controls.SelectionChangedEventArgs e)<br />{&nbsp;((Expression.Blend.DataStore.SelectedItemData.SelectedItemData)this.Resources["SelectedItemData"]).Property3 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;((Expression.Blend.SampleData.SampleDS.Item)(this.listBox1.SelectedItem)).Property3;<br />}<br /></span>Notice that <span style="color: #3366ff;">this.Resources["SelectedItemData"]</span>&nbsp; can be&nbsp;<span style="color: #3366ff;">Application.Current.Resources["SelectedItemData"]</span> depends on your project scope.</span></span></p>
<p><span style="color: #000000;">On Screen2:<br />Select <strong><span style="color: #993300;">Detail </span></strong>mode on datapane, multi-select properties on the datastore. drag then drop to the artborad, Blend would generate necessary xaml code for you.<br />Verify the layoutroot has such attribute: <span style="color: #ff6600;">DataContext="{Binding Source={StaticResource SelectedItemData}}"</span></span></p>
<p><span style="color: #000000;">Hit F5 to test run, when you select an item on Screen1 listbox, its values would display on Screen2</span><span style="color: #000000;"><br /></span></p>
<p><span style="color: #000000;">Same technic of using DataStore is applicable for databinding data across different&nbsp; windows/pages/screens.</span></p>
<p><span style="color: #000000;"></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/02/93/42/bindingScreen.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-02-93-42/bindingScreen.zip">bindingScreen.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Databinding for nested collections in XAML (WPF and Silverlight)</title>
      <link>https://docs.microsoft.com/archive/blogs/harryh/databinding-for-nested-collections-in-xaml-wpf-and-silverlight</link>
      <pubDate>Sat, 12 Jun 2010 00:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Harry.MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/harryh/2010/06/12/databinding-for-nested-collections-in-xaml-wpf-and-silverlight/</guid>
      <description><![CDATA[In Blend, you can drag a collection from the Data pane to the artboard to generate a listbox that is...]]></description>
      <content:encoded><![CDATA[<p>In Blend, you can drag a collection from the Data pane to the artboard to generate a listbox that is databound to the collection.&nbsp; You may then drag/drop (in <strong>Detail</strong> mode)&nbsp;properties under the collection to create textblocks databound to the selected item in the listbox. But if you have nested collections, this is currently not supported (v4). </p>
<p>This post shows sample code for databinding a nested collection:<br />Assuming there is an AuthorDataSource with this structure:</p>
<p>Authors (list)<br />&nbsp;- - Name<br />&nbsp;- - Books (list)<br />&nbsp;&nbsp;&nbsp;&nbsp; | -&nbsp; - Title<br />&nbsp;&nbsp;&nbsp;&nbsp; | -&nbsp; - Contents </p>
<p>Sample code :<br />&nbsp; &lt;Window.Resources&gt;<br />&nbsp;&nbsp;&nbsp; &lt;DataTemplate x:Key="ItemTemplate1"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;StackPanel&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBlock Text="{Binding Name}"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/StackPanel&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/DataTemplate&gt;<br />&nbsp;&nbsp;&nbsp; &lt;DataTemplate x:Key="ItemTemplate2"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;StackPanel&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBlock Text="{Binding Title}"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/StackPanel&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/DataTemplate&gt;<br />&nbsp; &lt;/Window.Resources&gt;<br />&nbsp; &lt;Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource AuthorDataSource}}"&gt;<br />&nbsp;&nbsp;&nbsp; &lt;ListBox x:Name="AuthorList" ItemTemplate="{DynamicResource ItemTemplate1}" ItemsSource="{Binding Authors }" &gt;<br />&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">&lt;ListBox x:Name="BookList"&nbsp; DataContext="{Binding SelectedItem, ElementName=AuthorList}" ItemsSource="{Binding Books }" ItemTemplate="{DynamicResource ItemTemplate2}" /&gt;<br /></span>&nbsp;&nbsp;&nbsp; &lt;TextBlock&nbsp; x:Name="BookContent"&nbsp;&nbsp; DataContext="{Binding SelectedItem, ElementName=BookList}"&nbsp; Text="{Binding Contents }" /&gt;<br />&nbsp; &lt;/Grid&gt;</p>
<p>The result would be 2 listboxes and a textblock.&nbsp; The AuthorList listbox would list names of authors.&nbsp; Selecting an author in AuthorList would list all books written by that author in the BookList listbox.&nbsp; Selecting a title in Booklist would display the contents of the book in the textbock.<br />&nbsp;</p>
<p>Same codes in&nbsp;listbox BookList&nbsp;are applicable to N levels of nested collections</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>