I have done this before to do what you ask for:
string cmdText = "select * from table where column like @INPUTTEXT";
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = new SqlCommand(cmdText,conn);
cmd.Parameters.Add(new SqlParameter("@INPUTTEXT", string.Format("%{0}%",INPUTTEXT)));
Aaron source
share