Navigation

Search

Categories

On this page

Todays Message Box Error and Solution
Tortoise SVN behind Proxy
Databinding to a XmlDataProvider in WPF

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 120
This Year: 1
This Month: 0
This Week: 0
Comments: 40

Sign In
Pick a theme:

# Wednesday, December 23, 2009
Wednesday, December 23, 2009 12:47:21 PM (Mountain Standard Time, UTC-07:00) ( All things Microsoft )

I've decided to start a new series of articles on how I solve various problems in my daily programmer lifee. Usually a problem has a distinct message box that shows up which you can copy the text of with the CTRL + C key combination. I think that a lot of people search directly for this text, and it woudl be awesome to have it solved. Maybe I'll even start a website some day to host these solutions so that people (or in a perfect world the vendor...) can post a solution to them. For today, here's my problem that I experienced inside of devenv.exe (Visual Studio 2008) today while trying to use the Server Explorer to add a new Data Connection.

---------------------------
Server Explorer
---------------------------
Unable to add data connection.

Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
---------------------------
OK  
---------------------------

I was tipped off by this forum post http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&tid=89ee0e86-b8fc-40a7-a0e1-51ac4033302e&cat=en_US_38f7e3d1-40bd-4daf-941f-f45d2ff6ff9b&lang=en&cr=US&sloc=&p=1

to install the SQL Server 2008 Managment Objects and Native Client, which you can get from here

http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en#filelist

Or more specifically, here

Microsoft SQL Server 2008 Management Objects X86 Package http://go.microsoft.com/fwlink/?LinkId=123708&clcid=0x409

Microsoft SQL Server 2008 Native Client X86 Package http://go.microsoft.com/fwlink/?LinkId=123717&clcid=0x409

Comments [0] | | # 
# Wednesday, December 02, 2009
Wednesday, December 02, 2009 8:30:39 AM (Mountain Standard Time, UTC-07:00) ( )
Sometimes you're at a building who proxies their internet connection and you need to get a copy of some code from sourceforge.net.

The Subversion FAQ has great info on this http://subversion.tigris.org/faq.html#proxy

The specific file you want is %APPDATA%\Subversion\servers

Edit the [global] section

# is the comment character. Remove it to enable the following sections

http-proxy-host # the IP address or hostname of the proxy (don't include http or https)
http-proxy-port # the port the proxy service is hosted on
http-proxy-username # username (sometimes you need the netBiosDomain\username)
http-proxy-password  # password
http-timeout  # in seconds
http-auth-types # authentication protocols.

Comments [0] | | # 
# Tuesday, October 06, 2009
Tuesday, October 06, 2009 9:46:36 AM (Mountain Daylight Time, UTC-06:00) ( All things Microsoft | Code )
I've resolved to start making the shift to WPF. It's about time. The technology has only been around for a good 3+ years. So far, I'm very excited by what I see. An invaluable reference has been Programming WPF 2nd edition by Chris Sells. Specifically the appendices. The explination of Xaml, and the Xaml Extensions removes the veil of confusion from all of the arcane looking symbols going on in the Xaml code. Thanks for the awesome book Chris! I was going through an article published in MSDN Magazine, Data Binding in WPF by John Papa. I encountered a very frustrating bug and I felt the need to let the next developer know about the solution I uncovered. (The next developer is sometimes me. I do very much love finding my own posts months or years down the road that help me out). Maybe this will help you out.

So, I'm building my Xaml out, and I have a perfectly good XmlDataProvider in my Resources.
<XmlDataProvider x:Key="MoreColors" XPath="/colors">
<x:XData>
<colors>
<color name="pink"/>
<color name="white"/>
<color name="black"/>
<color name="cyan"/>
<color name="gray"/>
<color name="magenta"/>
</colors>
</x:XData>
</XmlDataProvider>

I Created the Binding to my Listbox as such.


This whole thing is working in the Designer (Visual Studio 2008), but is displaying nothing at runtime. I whisk away to the MSDN Documentation for XmlDataProvider and find this clever little note.

The root node of the XML data has an xmlns attribute that sets the XML namespace to an empty string. This is a requirement for applying XPath queries to a data island that is inline within the XAML page. In this inline case, the XAML, and thus the data island, inherits the System.Windows namespace. Because of this, you need to set the namespace blank to keep XPath queries from being qualified by the System.Windows namespace, which would misdirect the queries.
Is it possible that this is the explination to the Debug output I'm seeing in Visual Studio at runtime?

System.Windows.Data Error: 47 : XmlDataProvider has inline XML that does not explicitly set its XmlNamespace (xmlns="").

I add the missing xmlns="" to the root xml element (as shown below), and things begin to work at runtime.

<XmlDataProvider x:Key="MoreColors" XPath="/colors">
<x:XData>
<colors xmlns="">
<color name="pink"/>
<color name="white"/>

In searching for the answer to this solution, I also came across this post Why WPF databinding is an awful technology. I hope this is not shared feeling of frustration many of us receive by wasted hours of our day with the Moteur de recherche du jour (search engine of the day). It's a really useful tool if you can convince it to give you the right answer, and people have posted about the particular phrase you're looking for.

Good luck reader, with your journey to WPF enlightenment. It has been worth my time.

Comments [0] | | #