read = com.ExecuteReader()
SqlDataReader
has a function Read()
that reads the next row from your query's results and returns a bool
whether it found a next row to read or not. So you need to check that before you actually get the columns from your reader (which always just gets the current row that Read()
got). Or preferably make a loop while(read.Read())
if your query returns multiple rows.