esb01
06-26-2004, 05:46 PM
I'm getting "Index was out of range. Must be non-negative and less than the size of the collection." error. Does anybody know what is it?
I have a sub which filters data from a table and then binds them to a datagrid. Something like -
'Build SQL string
da = New OleDbDataAdapter(SQL, ConnString)
da.Fill(ds) 'ds is a dataset
Session("View") = ds.Tables(0).DefaultView
dataGrid.DataSource = Session("View")
dataGrid.DataBind()
I can't debug this because it's working fine on my computer in devel. mode.
It also works when I enter a filter criteria on the server. But it doesn't when there is no criteria entered. Then I get the abovementioned message. I assume this is something related to the postback.
Any ideas? Thanks
I have a sub which filters data from a table and then binds them to a datagrid. Something like -
'Build SQL string
da = New OleDbDataAdapter(SQL, ConnString)
da.Fill(ds) 'ds is a dataset
Session("View") = ds.Tables(0).DefaultView
dataGrid.DataSource = Session("View")
dataGrid.DataBind()
I can't debug this because it's working fine on my computer in devel. mode.
It also works when I enter a filter criteria on the server. But it doesn't when there is no criteria entered. Then I get the abovementioned message. I assume this is something related to the postback.
Any ideas? Thanks