StuckInTheMiddle
Programmer
Hi,
I'm trying to hide the first 3 columns (out of 8) of a datagrid which i have bound to my resultset returned from my database (Oracle in this case).
Retrieving the data is fine, but an attempt to hide the columns following the advice in other posts here at tek-tips gives me a 'Index was out of range' error.
Dim DbConnection As New OracleConnection(f_strDbConnectString)
Dim cmdReport As New OracleCommand("select * from temp_report where issue='111150'", DbConnection)
Dim daOracle As New OracleDataAdapter()
Dim dsResults As New DataSet()
DbConnection.Open()
daOracle.SelectCommand = New OracleCommand(cmdReport.CommandText, DbConnection)
daOracle.Fill(dsResults)
grdMain.DataSource = dsResults.Tables(0)
grdMain.DataBind()
DbConnection.Close()
grdMain.Columns(0).Visible = False
All works well, the results get populated intot he table fine, but then trying to the last line fails no matter which column i try to hide.
I miss doing things in plain simple ASP so much, sniff. Any ideas?
I'm trying to hide the first 3 columns (out of 8) of a datagrid which i have bound to my resultset returned from my database (Oracle in this case).
Retrieving the data is fine, but an attempt to hide the columns following the advice in other posts here at tek-tips gives me a 'Index was out of range' error.
Dim DbConnection As New OracleConnection(f_strDbConnectString)
Dim cmdReport As New OracleCommand("select * from temp_report where issue='111150'", DbConnection)
Dim daOracle As New OracleDataAdapter()
Dim dsResults As New DataSet()
DbConnection.Open()
daOracle.SelectCommand = New OracleCommand(cmdReport.CommandText, DbConnection)
daOracle.Fill(dsResults)
grdMain.DataSource = dsResults.Tables(0)
grdMain.DataBind()
DbConnection.Close()
grdMain.Columns(0).Visible = False
All works well, the results get populated intot he table fine, but then trying to the last line fails no matter which column i try to hide.
I miss doing things in plain simple ASP so much, sniff. Any ideas?