tags:

views:

22

answers:

1

I have a table with two columns - the key contains the image name, like love_me.jpg. The second column contains the link for this image (IE: http:\...\love_me.jpg).

I want a query that will extract the link if I search using only "love".

A: 

The SQL command is pretty basic.

string sqlQuery = "SELECT imagelink FROM Dataimages where (imagename like '%" + keywords + "%')"

As for the C# part, that will depend a lot on where the data is located, what type of database it's in and what you want to do with the data once you've obtained it.

KevenDenen
is this syntax true string sqlQuery = "SELECT imagelink FROM Dataimages where (imagename like'" +"%"+keywords+"%" + "')"; where keywords is variable string ?
salamonti
Modified the answer to include answer to your comment.
KevenDenen