Where you have this code in the page load event
DataGrid1.DataSource = myDataSet
DataGrid1.DataMember = "Tabel"
DataGrid1.DataBind()
Session("data") = myDataSet
You are setting the
datasource and then calling the databind() method
When you call the dataBind() immediately, the onItemDataBound event is
called for each row of data.
In the itemDataBoundEvent, you are attempting to retrieve the dataset
from the session variable but at this point, when the page is first
loaded, you have not put anything in the session variable, when you
attempt to get the table from the
dataset hence the error.
If I change the code in the page load event to look like this instead,
Session("data") = myDataSet
DataGrid1.DataSource = myDataSet
DataGrid1.DataMember = "Tabel"
DataGrid1.DataBind()
Now when the item
data bound event is called, I am sure to have the data
in the session variable.