<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Data Connection Query</title><link>https://www.infopathdev.com:443/forums/thread/14335.aspx</link><pubDate>Thu, 23 Feb 2006 15:13:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14335</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14335.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14335</wfw:commentRss><description>Hi, &lt;br /&gt;You are using single quote in the query string, database thinks single quote as a starting of the string. &lt;br /&gt;You need to escape single quote with one extra single quote then it should work.&lt;br /&gt;&lt;br /&gt;So your query should be&lt;br /&gt;SELECT distinct FullName&lt;br /&gt;FROM bi_employee&lt;br /&gt;AS FullName&lt;br /&gt;WHERE LogonName=N''blah''&lt;br /&gt;ORDER BY "FullName"&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;INFOPATHdev India</description></item><item><title>Data Connection Query</title><link>https://www.infopathdev.com:443/forums/thread/12788.aspx</link><pubDate>Thu, 23 Feb 2006 07:33:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12788</guid><dc:creator>delu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12788.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12788</wfw:commentRss><description>I'm confused: I have a data connection:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select distinct "FullName" from "employee" as "FullName" order by "FullName"&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When I run this data connection from managed code, everything works fine. But when I put a 'where' statement in it, the result will always be "".&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT distinct FullName&lt;br /&gt;FROM bi_employee&lt;br /&gt;AS FullName&lt;br /&gt;WHERE LogonName=N'blah'&lt;br /&gt;ORDER BY "FullName"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When I exclude the "where" statement, everything works fine. the management studio performs the query without an error on manual try.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I assumed the XPath of the result set changed, but I just can't figure out to what. I tried everything I could imagine.&lt;br /&gt;&lt;br /&gt;Can anybody help me?&lt;br /&gt;&lt;br /&gt;Thanks a lot!!</description></item></channel></rss>