Search in Windows application can this be done ?

Posted by Chaithragm under C# on 3/21/2013 | Points: 10 | Views : 996 | Status : [Member] | Replies : 2
hi
1) I'm trying to create a full text search facility for a small windows application which is running against a SQL Compact Edition database.
can this be done ?how?

2)
im having two tables
table1->field1
field2
field3
id1 (id1,id2 are common in both the tables)
id2
table2->field1
field2
field3
id1
id2
I have to select the values from 2 tables where keyword=(i will enter abc ->abc may present in any of the fields in 2 Tables)
How to write write sqlCE query for this




Responses

Posted by: Jayakumars on: 3/22/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

try this code

Select * from t1,t2 where t1.Id1=t2.id1 AND t1.field1 LIKE '%abc%'

Mark as Answer if its helpful to you

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 3/22/2013 [Member] Starter | Points: 25

Up
0
Down
How to join 2 tables

This is the query im using

string sql = "Select d1.type,f1.wardrobe_name,f1.rack_name,f1.filename,f1.reference1,f1.created_date,d1.title,d1.tag1,d1.date from Documents AS d1 JOIN Files AS f1 ON d1.wardrobe_name=f1.wardrobe_name and d1.rack_name=f1.rack_name where tag1='" + keyword + "' or tag2='" + keyword + "' or tag3='" + keyword + "' or tag4='" + keyword + "';";

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response