Showing posts with label enter. Show all posts
Showing posts with label enter. Show all posts

Tuesday, March 20, 2012

Asterisk in SQL

I'm trying to creat a search form and want to use the Like clause in my select statement so that a user can enter part of a word rather than the entire word. When I use this sql I get no results:

SELECT DISTINCT Keyword.CodeID FROM Keyword INNER JOIN Code ON Keyword.CodeID = Code.CodeID WHERE ((Keyword.Keyword)Like '*ARR*'AND (Code.ProgLang)='VB.NET') ORDER BY Keyword.CodeID

The problem is with the * . If I remove the * it works fine. If I use the code within Access rather than from my aspx code, it works fine. Is there a work around for this?

Hi,

% (percent) is the standard wildcard character. Access client does support *, but when you use it via OleDB (Jet provider) it also requires %.

Therefore put

SELECT DISTINCT Keyword.CodeID FROM Keyword INNER JOIN Code ON Keyword.CodeID = Code.CodeID WHERE ((Keyword.Keyword)Like '%ARR%'AND (Code.ProgLang)='VB.NET') ORDER BY Keyword.CodeID

|||That did it. Thanks!!!

Thursday, February 9, 2012

asp.net

I have a file that has details as,

name :- name@.xx.com
subject :- xxxxxxxxxxxx
date :- dd-mm-yyyy
:
:

I need to read that file and enter those detials in to a sql database table.The table has three columns seperately to take those data as name,subject and date.

I need c sharp code for that.At least give it a go, it's not that hard. Have a read of ADO.NET. Granted this is a forum to help people but I, for one, am not simply going to do your job.