RE: DataAdapter returns 0 results, what am I doing wrong?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Kerry Moorman (KerryMoorman_at_discussions.microsoft.com)
Date: 02/02/05


Date: Tue, 1 Feb 2005 18:23:03 -0800

Matt,

You might need to use the % character instead of the * character with Like:

     AND Appointments.Details LIKE "%test%";

Also, double-quote delimiters might work, but you might need single-quotes:

     AND Appointments.Details LIKE '%test%';

Kerry Moorman

"Matt Michael" wrote:

> where queryString is the string I have constructed. It looks like this:
>
> SELECT Appointments.AppointmentID, Appointments.AppointmentTime,
> Buildings.Building, Appointments.RoomNumber, Appointments.Details FROM
> (Appointments INNER JOIN Buildings ON
> Appointments.BuildingID=Buildings.BuildingID) INNER JOIN Technicians ON
> Appointments.TechnicianID=Technicians.TechnicianID WHERE 1 = 1 AND
> Technicians.TechnicianName = "Matt" AND Appointments.Details LIKE "*test*";
>



Relevant Pages

  • for xml explicit data problem
    ... character padding like shown beow. ... Declare @EmpToMan table( ... inner join @EmpToMan as t10 ...
    (microsoft.public.sqlserver.xml)
  • Re: How to delete the following file
    ... No confusion here unless you don't understand that the back-slash is an ... "escape" character, not part of the file name. ... entire name in single-quotes, then escaping the offending character (the ... The issue is that the file name commences with a dash, ...
    (RedHat)
  • Re: Which is faster?
    ... multibyte characters enclosed in single-quotes, ... in C99: ... than one character, or containing a character or escape ... sequence that does not map to a single-byte execution character, ...
    (comp.lang.c)
  • Re: Which is faster?
    ... "An integer character constant is a sequence of one or more ... multibyte characters enclosed in single-quotes, ...
    (comp.lang.c)
  • Re: Which is faster?
    ... multibyte characters enclosed in single-quotes, ... in C99: ... than one character, or containing a character or escape ... sequence that does not map to a single-byte execution character, ...
    (comp.lang.c)