| Author: Syed Shakeer Hussain 07 Jan 2009 | Member Level: Diamond | Rating:  Points: 3 |
Hi Using the % Wildcard:
Now we want to select the persons living in a city that starts with "sa" from the "Persons" table.
We use the following SELECT statement:
SELECT * FROM Persons WHERE City LIKE '%s'
SqlCommand cmd=new SqlCommand("SELECT * FROM Persons WHERE City LIKE '%s'",conn);
SqlDatReader reader=Cmd.ExecuterRader(); while(reader.Read()) { //gridview show here
}
}
Thanks & Regards! Syed Shakeer Hussain
|