I have some textbox to send one word to sql database. i want to fine this word in a coulmn that holding few words. i cant figure it out what the correct queary iv'e try the LIKE statement in many ways but still nothing. The word can be at the first, middle or the end of the line. for example: the user write "sun" and in the DB table there is an addres: "Johnson Blvd 3647 sun corner, CA" because there is the word "sun" this record will show on.
the code is:
private void button3_Click(object sender, EventArgs e)
{
ShowbillboardsByNumber.Clear();
SqlConnection sqlcon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["forumArtDatabase"]);
SqlCommand sqlcmd = new SqlCommand("SELECT * FROM orders WHERE billBoardNumber LIKE @p1", sqlcon);
sqlcmd.Parameters.Add(new SqlParameter("@p1", SqlDbType.VarChar)).Value = billBoardNumber.Text;
sqlcon.Open();
SqlDataAdapter da = new SqlDataAdapter(sqlcmd);
da.Fill(ShowbillboardsByNumber);
dgByNumber.DataSource = ShowbillboardsByNumber;
sqlcon.Close();
}