I think you forgot the line below after this line SqlCommand mycommand = new SqlCommand("SELECT KnowledgeID, FixName FROM Knowledge WHERE Location LIKE '%.txt%' AND SAPPS = 'False'", myConnection)
mycommand .CommandType = CommandType.Text;
mycommand .ExecuteNonQuery();