Last post Oct 03, 2016 07:21 PM by gribber1
Oct 02, 2016 05:33 PM|gribber1|LINK
In my script (c#) i will give a command to search the database by the frst letter of a name.
when i was tested my queriei find out that the search is by the last letter of the name, even if i try to change the querie, it will never give's me a search by the first letter.
maybe someone can tell me whats wrong in my script?
cmd.CommandText = "select * from MusicCollect WHERE Artist LIKE '%" + Artist_name + "'";
Oct 02, 2016 08:42 PM|Sumit.Pokhriyal|LINK
Try below. The % should be at last to search from beginning:
cmd.CommandText = "select * from MusicCollect WHERE Artist LIKE '" + Artist_name + "%'";
Oct 03, 2016 08:47 AM|balu.devara|LINK
use like bellow.
Oct 03, 2016 02:53 PM|PatriceSc|LINK
In addition you may want to use parameterized queries. Search for this or see for example
Oct 03, 2016 07:21 PM|gribber1|LINK
Thanks for reply in knew it must be @ the end because in front it was sarch for the last letter, the
quotes are the difficulty i had troubles to place time in the right way.
Now it is working,
I will read the page u give me thanks for it