Hi all!
I want to replace the values of QID in my datalist1 bound with the following
data:
Dim sqlStmnt As String = "Select QID, QUESTION from ENVIRONMENTAL_EXAM order by newid() "
Dim myda As SqlDataAdapter = New SqlDataAdapter(sqlStmnt, scon)
Dim ds As New DataSet
myda.Fill(ds, "Table")
DataList1.DataSource = ds
DataList1.DataBind()
'--code to replace the values of QID ????
'----------------------------------
My sqlcommand return random sets of records, as well as the QID. I want to
replace each QID with sequential values(1 to N), but i don't know how to do this
on datalist. The idea is just like replacing the values in a datagrid after databind. Please see below sample..
'-----------------------------------------------------------------------
Datagrid1.Databind()
Dim item, i, ctr As Integer
Dim temp as string
ctr = 0
item = datagrid1.Items.Count()
For i = 0 To item - 1
ctr = ctr + 1
datagrid1.Items(i).Cells(1).Text = ctr
Next i
'------------------------------------------------------
Can anyone tell me how to do this on datalist? Or if you could suggest more practical approach, please do...
Looking forward for your help. Thanks in advance...