Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where in Winform to load this data
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Where in Winform to load this data
Miscellaneous
Thread ID:
00765705
Message ID:
00765705
Views:
39
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
Next
Reply
Map
View

Click here to load this message in the networking platform