Why would you fill them one by one?
SELECT * FROM GLMAST WHERE "put those conditions that return you the list of need IDs
Set this as your command query and
DataSet ds = new DataSet;
DataAdapter da = New DataAdapter
da.Fill(ds)
Please move the code from comment into the question. Thank you.