I am experiencing issues with the like query not working. Can someone help me troubleshoot? Below is the code I am using:
string Item_Name = txt_search.Text.Trim();
string Conn = ConfigurationManager.ConnectionStrings["AjitConnectionString"].ToString();
OleDbConnection con = new OleDbConnection(Conn);
con.Open();
OleDbCommand cmd;
cmd = new System.Data.OleDb.OleDbCommand("select * from [Item] where [Name] like '*'+inamer_Name+'*'", con);
cmd.Parameters.AddWithValue("@inamer_Name", Item_Name);
cmd.ExecuteNonQuery();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
grid_itemedit.DataSource = dt;
grid_itemedit.DataBind();
con.Close();