Re: Wildcard "%" not working

From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 05/22/04


Date: 22 May 2004 13:47:28 +0200


* maha_ice@yahoo.com (MB) scripsit:
> I am using a datagrid and the datagrid is filled through the SQL
> query. The SQL query searches for the match in the database. The SQL
> Query that i am writing is as follows
>
> Dim selprod As String = "SELECT ProductID, ProductName FROM Products
> WHERE ProductName LIKE '%prod%'"
>
> but it is not working.
> If I use the query this way(as given below) it works but I want to use
> wildcard so that it searches thoroughly and provide with me with all
> the records
>
> Dim selprod As String = "SELECT ProductID, ProductName FROM Products
> WHERE ProductName LIKE '" + prod + "'"
>
> If i use LIKE '" +%prod%+ "'" or something sort of like this it doesnt
> work either... any idea how it will work.

Your question is 0 percent related to VB.NET. Please post to the
appropriate group in future:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

Thank you for your cooperation!

-- 
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: Data Relation question
    ... Seems to me that either you're filling the event data before you're filling ... The Sql statement you have ... > When I run the Query, ... > I would like to show all the contacts in the first datagrid. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Populating a list -- table structure?
    ... I had made a report already and figured out about adding the ... your responce below, but thanks to your help with SQL, I was able to get the ... It takes a summary from a select query and gives the ... KitID, long integer ...
    (microsoft.public.access.forms)
  • How do I do Paging through a large dataset via Stored Procedures
    ... Paging by dynamically altering the SQL Query ... Create stored procedures ... SELECT * FROM STUDENTS ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Populating a list -- learning Access
    ... It is kinda funny -- I started using databases in the early 80's with dBase and, for years, never knew that I knew SQL! ... If you are on a form or report, the most important property is the NAME, because that is how you refer to it in code. ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)

Loading