"Andres Sanabria" <AndresSONLINE@Microsoft.com> a écrit dans le message de
news: mCTBELvECHA.1560@cpmsftngxa07...
> Are you placing this code in the page load event?
>
> AndresS
Yes. Here is my code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim sConnectString As String = Session.Item("connect_string")
Dim oCon As New OleDb.OleDbConnection(sConnectString)
Dim sSQL As String
sSQL = "select lastname + ' ' + firstname as nom_complet, login from
owners order by lastname"
Dim oCom As New OleDb.OleDbCommand(sSQL, oCon)
oCom.Connection.Open()
Dim oReader As OleDb.OleDbDataReader = oCom.ExecuteReader()
list_owner.Items.Clear()
'Do While oReader.Read
'list_owner.Items.Add(oReader.Item("nom_complet").ToString())
'Loop
' The methode shown befor, OR the next one
' On peut remplir la Selection list en utilisant le data binding
list_owner.DataSource = oReader
list_owner.DataTextField = oReader.Item("nom_complet")
list_owner.DataValueField = oReader.Item("login")
list_owner.DataBind()
oReader.Close()
oCon.Close()
End Sub
Herve.