It seems like the datatable object "dt" isn't getting persisted on postback.
You're initializing it (by doing the dataadapter.fill) in btnadd_Click( ) -
which occurs during one round trip, but then you're later referencing it in
IndexChanged( ) - which executes during a different round trip. In order
for the datatable object to have data, you'll need to either fill it from
the database again, or you'll need to stick it into cache/session
variable/or viewstate after you've filled it the first time. Then when you
want to pull data out of it in IndexChanged( ), you'll first need to
re-populate it from whichever persisting method you've used...