I'm planning to select all rows in my datatable that has 'Dog' in column 2 without using keyword "WHERE" on my query. My guess is to try using DataRow and foreach but I'm not sure where to start. I filled my datatable with records coming from my database and this is what I've done so far.
using(MySqlConnection con = new MySqlConnection(constring))
{
MySqlDataAdapter adp = new MySqlDataAdapter("SELECT * FROM table1",con);
DataTable dt = new DataTable();
adp.Fill(dt);
adp.Dispose();
}
This is what my datatable looks like:
Column1 Column2 Column3
1 Dog Labrador
2 Dog Chowchow
3 Cat Persian
4 Cat Stubby
5 Dog German Shepherd