Binding a Database to Datagrid / Repeater

  • Thread starter Kristoffer Arfvidson
  • Start date
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
 
K

Kristoffer Arfvidson

Sure, I havnt really done anything to the datagrid1 control...
I simply added it to the document so far...
Of course I will need Templates on it, to make it usefull on my page, but I
wanted to first get the databinds done, so I then can figure out how to make
the design work...

Yours: Kristoffer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top