Never do that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
Additionally, the quote is in the wrong place.
The chances are that using a parameterised query will remove your problem - and don't forget the rest of your code: one missed command and anyone can delete your database.
using (SqlCommand cmd = new SqlCommand("SELECT * FROM gvdetails17 WHERE EmpName LIKE '%' + @Txt + '%'", cn))
{
cmd.Parameters.AddWithValue("@Txt", txt_SearchName.Text);
...