[VB.NET] RadioButtonList ne renvoi pas le 1er enregistrement
Bonjour tt le monde,
J'ai une RadioButtonList qui ne me renvoi pas le premier enregistrement de ma table.
Ma requete SELECT fonctionne bien sur SQL Serveur. Si j'ajoute un enregistrement j'ai les deux derniers, mais jamais le premier.
J'ai oublié qqch?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub radsecondapprover_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles radsecondapprover.Load
strSql = "SELECT CG_ID, CG_Function " & _
"FROM ClientGroupUserFunction " & _
"ORDER BY CG_Function;"
Me.myCommand = New SqlCommand(strSql, myConnection)
Me.myReader = myCommand.ExecuteReader()
Try
Me.myReader.Read()
Me.radsecondapprover.DataSource = Me.myReader
Me.radsecondapprover.DataTextField = "CG_Function"
Me.radsecondapprover.DataValueField = "CG_ID"
Me.radsecondapprover.DataBind()
Catch ex As Exception
'TODO : Create redirect if error
Response.Write("Error : " + ex.Message)
Finally
Me.myReader.Close()
End Try
End Sub |