.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Querying a field that contains CR/LF returns no results

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Using SqlCeCommand without parameter binding, I'm running a query against a field that contains a carriage return and line feed.  On the .NET side of things, the query I'm executing is passing "\r\n".  I get no results back.  Shouldn't this work?

Thank you,


View Complete Post

More Related Resource Links

AdomdDataAdapter.Fill returns memory error when querying an SSAS Cube(2008)

For certain SQL's I will get the following error when calling the Fill method on an AdomdDataAdapter object. "Memory error: While attempting to store a string, a string was found that was larger than the page size selected. The operation cannot be completed."   Snippet of Code: DataSet ds1 = new DataSet(); AdomdCommand acmd1 = cn1.CreateCommand(); acmd1.CommandText = "SELECT ..."; AdomdDataAdapter ad1 = new AdomdDataAdapter(acmd1); ad1.Fill(ds1);   Now when we run this query in Ms Sql Studio we don't get any errors but the query returns 1 row with over 40,000 columns. I'm guessing the # of columns might be an issue but not sure.   When doing a Google search it appears that this problem was found in the 2005 and fixed in that version. Have any of you come across this problem?  

SharePoint Search Server 2010 Express returns no search results for non-admin users

This is going to sound crazy, but anyway... bare with me... I have a SharePoint Search Server 2010 Express (RTM) installed with a crawl account (call it sharepoint_crawl) which has full read permission to an entire site collection of 100,000 documents. I have logged in with this account to make sure it has read access to everything, and it does. I run a full crawl of all documents and allow it to finish. If I try and search the content for an extremely common term (i.e. 50,000+ hits) I get no results. However, if I log in with a site collection admin I do get search results. There are no indexing errors or query errors in either log files or event log. Everything looks like it is working correctly - just no results for non-admins Anyone tripped on this? I have recreated the crawl account and perform a full re-index with the same results. What gets me is that the crawl account does have read permission to the content it is indexing, the content is indexed correctly, but the crawl account cannot get results back. It is as if security-trimming is removing everything. Any ideas?

FullTextSqlQuery with Like returns no results

I have a problem with FullTextSqlQuery.  First I made sure I am using Office.Server.Search as you can see from the code below.  I have written the full namespace just to be sure :) Microsoft.Office.Server.Search.Query.FullTextSqlQuery myQueryFull = new Microsoft.Office.Server.Search.Query.FullTextSqlQuery(thisWeb.Site); Running this query it returns all the items in my custom list and scope - so far so good. myQueryFull.QueryText = "SELECT Title, Path,Description,Write,Rank,Size FROM SCOPE() WHERE \"scope\" = 'Car List Definition'"; The following also works fine and filters the elements correctly. myQueryFull.QueryText = "SELECT Title FROM SCOPE() WHERE \"scope\" = 'Car List Definition' AND FREETEXT('Toy*')" ;       BUT BUT BUT, the following returns empty list.  The same if I use Contains instead. myQueryFull.QueryText = "SELECT Title FROM SCOPE() WHERE \"scope\" = 'Car List Definition' AND Title LIKE '%Toy%'";       Any idea what's wrong? I am using sharepoint 2010. Thanks

Querying, getting the results and re-using the results on a different datasource and dataset. Is it

Hello all,  I have a dataset that is running a very simple query, pulling an OrderID field based on the TransactionID parameter (User Input).  This dataset is pointed to Database_A. SELECT OrderID FROM Orders WITH (NOLOCK) WHERE OrderID = @TransactionID   Now, this query above might return one of more records. I need to query another system (Database_B) using the results from this query. I need to store the OrderIDs that I got somewhere and check them against another system and display the results on my report. Please note - Database_B is located on a totally different server.  Can you guys think of a way of doing this? I'm using SSRS 2008, not 2008 R2.

show a "no results" message if a db query returns nothing

I inherited some C# code behind that queries a database table and need to add something that displays a "No results" message (using a Label web control, perhaps) if the query doesn't return any records. I'm just learning C# but am coming up short on how to do this. Would anyone be kind enough to point me to an example, or demonstrate? Thanks a lot. Here's the code I inherited (the programmer who wrote this is no longer available). This is the code behind from the search results page:using System; using System.Text; using System.Data; using System.Data.Common; using System.Data.SqlClient; using System.Collections; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Maine_Innkeeper_Site_2010 { public partial class lodging_search_output : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string sql = Session["logdingSearchSql"].ToString(); SqlCommand cmd = common.openDatabase(); cmd.CommandText = sql; string PreviousTown = ""; try { StringBuilder sb = new StringBuilder(); SqlDataReader rdr = cmd.ExecuteReader(); sb.Append("<ul class=lodging-search-initial-results>"); while (rdr.Read()) {

Error accessing Search Settings and search returns 0 results

Quick summary - my MOSS 2007 server died. I brought up a new server, installed MOSS, service pack 1, service pack 2, created the new config database, then attached my existing content database (I have a separate physical server for the databases). After a few tweaks to get most of the other settings back in order, (most) everything seems to be working somewhat as it should except for Search. Whenever I try to access Search settings I get an error: "An error occurred during the processing of . The resource object with key 'S2SearchAdminDashboard_Title' was not found". I created a new SSP with it's own unique account for the service and app pool (read online that it should be different than SharePoint account because of the timer service conflicting with search), I tried copying the files (listed here: http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/1a93ef86-be5a-44ad-a814-14613fd0a78f) from my test environment with no luck, I've made sure the permissions to the Task Scheduler were correct (found a Google blip about that somewhere), I've deleted and re-installed the SSP multiple times, ran the Configuration Wizard more times than I can count, but no matter what I do it never changes and always gives the same error. Also, whenever I try to access Central Admin it tries redirecting me to http://servername:portnumber/_admin/SearchServerW

BDC field returns wrong value in the Value Picker



I have a BDC entity in an application with multiple functioning entities but one of the entities is not behaving.

it returns a list of varchar(100) values and it works in application configuration tool when tested.

When I use the Picker, I see the values in the list but when I select a value and the picker closes, the value left in the control on the screen is not the value I selected "Technical" but a value I do not understand


no data in the table even resembles this value.  I have a hunch this is the word "Technical" in some encoded form.


Here is a snippet from the BDC definition

The GetAll method is the one that is causing the pain. 

any help would be greatly apreciated.


 I had to delete the top two methods to get this to post on this site.(they were the auto created methods from the BDC tool

The error w

How is the HitHighlightedSummary field derived in the search results?


Can anybody tell me exactly how this field is derived in the search results?

I have a custom list with various fields. One field is an HTML field which typically contains a large amount of HTML content. This field has been mapped to a managed property and the list is being cawled.

When a search is executed with a keyword, sometimes the HitHighlightedSummary returned from search contains the keyword and sometimes it does not. The only thing that appears to be different between the list items is the position of the keyword within the HTML content. The keyword appears early in the content for the list items that return the keyword in the HitHighlightedSummary but it appears well down in the content when it is not included in the HitHighlightedSummary. When the keyword is not included, HitHighlightedSummary seems to contain a combination of data from a number of fields.

Is it possible that HitHighlightedSummary only considers the first N characters/bytes of fields?


Stored procedure returns two select results


Hey guys

I am creating a buddy list and I need to select my entire buddy list and then the ones that are online

I have two querries one is your standard


FROM buddies


the other is a bit more complicated


SELECT Buddy as Online
FROM Buddies
FROM online 
WHERE online.Buddy = Buddies.Buddy)

I can't use the union command since I create another column

What I would like is to append the column to my original result so I can access it from some vb script using the sqlclient.datareader


Search This Site: Returns no results.



I am in the process of implementing MOSS 2007 and we have 2 site collections.   When we get to either site there are 2 search option This Site:  and All Sites.   All sites returns all the results but when search This Site I get no results.     We removed the People Scope because we aren't implementing mysites with the first release.    



Does anyone have any suggestions.   I had Microsoft on the phone yesterday but they didn't seem to be able to help.  


Reset HiddenField if AutoCompleteExtender returns no results


Hi i need to be able to reset a HiddenField's value if my AutoCompleteExtender returns no results (specifically, if the user searches for something that's not in the list/database). I have this JS code now:

function autoCompleteItemSelected(source, eventArgs) { 
    var assocHiddenField = document.getElementById(source.get_id() + '_hidden'); 
    assocHiddenField.value = eventArgs.get_value(); 

How would I modify this to check if the list is null? Currently it seems to just leave the value as it was previously.


GetUsageData() returns inaccurate results


I am trying to get information on site visits using the following function:

private static void PrintUsage(SPWeb web)
  SPUsageReportType reportType = SPUsageReportType.user;
  DataTable dataTable = web.GetUsageData(reportType, SPUsagePeriodType.day, 1, DateTime.Today);

  if (dataTable == null)

  foreach (DataColumn col in dataTable.Columns)
    Console.Write(col + " | "); 


   foreach (DataRow row in dataTable.Rows) 
     foreach (var item in row.ItemArray)
      Console.Write(item + " | "); 

The function is getting invoked like this:

SPSite siteCollection = new SPSite(

GetUsageData() returns inaccurate results


I am trying to get information on site visits using the following function:

private static void PrintUsage(SPWeb web)
  SPUsageReportType reportType = SPUsageReportType.user;
  DataTable dataTable = web.GetUsageData(reportType, SPUsagePeriodType.day, 1, DateTime.Today);

  if (dataTable == null)

  foreach (DataColumn col in dataTable.Columns)
    Console.Write(col + " | "); 


   foreach (DataRow row in dataTable.Rows) 
     foreach (var item in row.ItemArray)
      Console.Write(item + " | "); 

The function is getting invoked like this:

SPSite siteCollection = new SPSite(

[sql 2008] Querying XML with XSD-definition gives no results



Currentyly i am trying to parse some XML documents as part of a query.
in it, i need to convert to an XML (source is Ntext and i cannot just alter the source-database).
So this should be no issue with the XML handeling of 2008 but something odd is going on, i have an XSD definition in the file but i have no XSD-schema's in the database. SO i would expect its a untyped XML even if the XML has an XSD-reference attached, but if i run the query i get 0 results.
If i remove the XSD-tag, the query gives results. To demonstrate this i have create the query attached below that isolates my issue. Has anybody seen this before and know a way around it?

With kind regards,

Sebastian van den Putten

DECLARE @Document varchar(max)
DECLARE @DocumentWithXSD varchar(max)

set @Document = '<CreateCustomerInput >

set @DocumentWithXSD = '<CreateCustomerInput

sp_validatelogins returns unexpected results




On a 2005 SP3 SQL box, as part of an audit I ran this sp and the results it returns appear to be incorrect.


It returned  DOM\SQL Users, a windows group I asked our AD Admins to set up. We have a e-business app that authenticates using this group so I know it's valid and I know works otherwise my phone would be ringing off the hook.


To make sure I wasn't going mad though,  I asked out AD Admins to verify that this group exists and is enabled. It was, of course.


So then I xp_logininfo to see what it said:


EXEC xp_logininfo 'DOM\SQL Users

Search returns no results for non admin users

Hi all, I can't seem to get search to return results for non-admin users. I can search fine as the administrator - but non admin users, although they can see the rest of the site content with no issues, they can't get any results on the search. I'm using MOSS 2007 on a server farm - the search config appears to be set up correctly but I can't find any info on why it might not be returning results for non admins - I would have thought security trimming would have stopped users from seeing content - so is there some way that users would be able to see the site but still not have 'real' access to it?

Passing parameter to Subreport dataset query returns no results



I'm using the subreport as a workaround to not being able to join two disparate datasets. The "tickler" file  of keys comes from an Access DB defined as a dataset in my main report. The subreport has a dataset query using parameters from the main report. 

When subreport returns no results, I want to display an error message in the main report and continue to the next row key processing. How do I accomplish that?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend