Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where in Winform to load this data
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Where in Winform to load this data
Divers
Thread ID:
00765705
Message ID:
00765705
Vues:
38
I created a sub LoadLookUps() and put this code in it. Then from the Form_load I put LoadLookUps(). But it never loaded my drop down. But if I Put a button on the form, and it calls LoadLookUps() then it works fine. I'm missing something small I think.

Thanks for any help.
   Private Sub LoadLookUps()
        'Create a Connection
        Dim oConn As System.Data.OleDb.OleDbConnection
        Dim oCommand As New OleDbCommand()

        oCommand.CommandText = "ct_lu_AuthorizedDeptsByUsers"
        oCommand.CommandType = CommandType.StoredProcedure

        'Create a new parameter and add it to the parameters collection
        Dim oParam1 As New OleDbParameter("@tiUserID", OleDb.OleDbType.Integer)
        oParam1.Value = gnUserID
        oCommand.Parameters.Add(oParam1)
        'Connect to Database
        oConn = SqlConnect(gcConnString)
        oCommand.Connection = oConn
        Dim goView As New Data.DataView()
        'Load the DataView
        goView = VFPToolkit.vfpData.SqlExecute(oConn, oCommand, "Departments")
        If VFPToolkit.files.File("C:\dev.cqi") Then
            VFPToolkit.vfpData.Browse(goView)
        End If
        Me.ComboBox1.DataSource = goView
        Me.ComboBox1.DisplayMember = "deptdesc"
        Me.ComboBox1.ValueMember = "deptid"

    End Sub
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform