K
Kristoffer Arfvidson
How, do I bind a database to either a Datagrid or a repeater (via
PagedDataSource)??
Im, trying everything, but I simply cant get it...
I use RS.GetRows to get all the info at once from the database...
I always gets the error msg that the datasource was not an one dimensional
array, witch of course it isn´t, but how else am I going to bind the data?
Yours: Kristoffer
--------------------------------
Dim objConn As New ADODB.Connection
Dim cm As New ADODB.Command
Dim tmpRs As New ADODB.Recordset
objConn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
' Create a command object. This object serves to run our queries
objConn.Open(sConnectDP)
cm.CommandText = sSqlStr
' Set the query type. 1 means it is a SQL statement
cm.CommandType = 1
' Retrieve the results in a recordset object
cm.ActiveConnection = objConn
tmpRs = cm.Execute
DataGrid1.DataSource = tmpRs.GetRows
DataGrid1.DataBind()
tmpRs.Close()
tmpRs = Nothing
cm = Nothing
objConn.Close()
objConn = Nothing
PagedDataSource)??
Im, trying everything, but I simply cant get it...
I use RS.GetRows to get all the info at once from the database...
I always gets the error msg that the datasource was not an one dimensional
array, witch of course it isn´t, but how else am I going to bind the data?
Yours: Kristoffer
--------------------------------
Dim objConn As New ADODB.Connection
Dim cm As New ADODB.Command
Dim tmpRs As New ADODB.Recordset
objConn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
' Create a command object. This object serves to run our queries
objConn.Open(sConnectDP)
cm.CommandText = sSqlStr
' Set the query type. 1 means it is a SQL statement
cm.CommandType = 1
' Retrieve the results in a recordset object
cm.ActiveConnection = objConn
tmpRs = cm.Execute
DataGrid1.DataSource = tmpRs.GetRows
DataGrid1.DataBind()
tmpRs.Close()
tmpRs = Nothing
cm = Nothing
objConn.Close()
objConn = Nothing