> 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 >