SQL Datareader reading from a specific line
Posted on 2010-08-29
I have been working with a SQL table and asp.net recently and have been getting my SQL Data reader to read from only a single line in a database table.
Now I would like to read from 1 - 35 lines but only show certain information when called.
I think I am ok with my if statemens in vb.net, but I dont know how to call line one, then the data from that line, then from line two and so on...
Th script that I am currently using is
dim SQLConn As New SQLConnection()
dim SQLcmd As New SQLCommand
dim SQLdr as SQLDataReader
SQLCOnn.ConnectionString = ConnString
SQLCmd.Connection = SQLConn
SQLCmd.CommandText = SQLStr
SQLdr = SQLCmd.ExecuteReader
If SQLdr.Read = true then
ObjectivesTxt.Text = SQLdr.Item("OBjective").ToString
GoalTxt.Text = SQLdr.Item("Goal").ToString
Strategy1Txt.Text = SQLdr.Item("Strategy_1").ToString
Measure1Txt.Text = SQLdr.Item("Measure_1").ToString
On Each different lines there is a different set of Objectives, Goals Strategies and Meaures and I want to dynamically pull these out on a line by line request.
Any and all help is very much appreciated.