In my Page load I have
If Page. isnotpostback then
Cmd.Connection = conn
Cmd.CommandText = "Get_Data"
cmd.CommandType = CommandType.StoredProcedure
SqlAdp.SelectCommand = cmd
SqlConn.open
SqlAdp.Fill(DTData)
Sqlconn.Close
Session("Data") =DTData
Then later on a button click I have
Dim dr as DataRow
Dim table as DataTable = CType(Session("Data"), DataTable)
For each row in Table.rows
Dim strCol1 as String = table.Columns.Item(0).toString
Dim strCol2 as String = table.Columns.Item(1).Tostring
|