Need an idea about binding to a datagrid

zerosp

New Member
I have a datagrid that displays the hours in the day. I need a way to grab a chunk of data from the database and decide where in the grid it belongs. I could do this by creating the datagrid in a couple of for next loops:<BR><BR> For i = 1 To 12<BR> drow = dt.NewRow()<BR> drow("title") = i & " AM: "<BR> dt.Rows.Add(drow)<BR> Next<BR> i = 1<BR> For i = 1 To 12<BR> drow = dt.NewRow()<BR> drow("title") = i & " PM: "<BR> dt.Rows.Add(drow)<BR> Next<BR><BR>But then to match the data record with the correct row I would have to call the sql command each time (datareader or executescalar If I limit it to one record). I would rather not make 24 sql calls each time this is loaded. So, does anyone know a way that I can grab a chunk of data and keep it somewhere to test for the appropriate record?
 
Back
Top