我有一个表单,我需要在组合框中显示数据。数据保存在数据库中,但是当我再次打开表单时,数据会消失。 以下是代码。请帮忙修理。
Private Sub ReqEntryForm_Load(ByVal sender As Object, ByVal args As EventArgs)
SearchOnWarehseAdapterFillDropDown()
cboDivision.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList
cmbJobCode.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList
End Sub
Private Sub SearchOnWarehseAdapterFillDropDown()
' Wizard Generated Search Method
' You will need to call this method from another method in custom code
' For example, [Form]_Load or [Button]_Click
Dim recSelected As Boolean
Dim whereClause As String = string.empty
Dim dsWarehseAdapter As System.Data.DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(Me.oTrans, "WarehseAdapter", recSelected, false, whereClause)
If recSelected Then
' Set EpiUltraCombo Properties
Me.cboDivision.ValueMember = "WarehouseCode"
Me.cboDivision.DataSource = dsWarehseAdapter
Me.cboDivision.DisplayMember = "Description"
Dim fields() As String = New String() {"Description"}
Me.cboDivision.SetColumnFilter(fields)
End If
End Sub
Private Sub SearchOnWhseBinAdapterFillDropDown(row as Datarow)
' Wizard Generated Search Method
' You will need to call this method from another method in custom code
' For example, [Form]_Load or [Button]_Click
Dim recSelected As Boolean
Dim whereClause As String = "WarehouseCode = '" + row("Character02")+ "'"
Dim dsWhseBinAdapter As System.Data.DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(Me.oTrans, "WhseBinAdapter", recSelected, false, whereClause)
If recSelected Then
' Set EpiUltraCombo Properties
Me.cmbJobCode.ValueMember = "Description"
Me.cmbJobCode.DataSource = dsWhseBinAdapter
Me.cmbJobCode.DisplayMember = "Description"
Dim fields() As String = New String() {"Description"}
Me.cmbJobCode.SetColumnFilter(fields)
End If
End Sub
'dim iscode as boolean
Private Sub ReqHead_AfterFieldChange(ByVal sender As Object, ByVal args As DataColumnChangeEventArgs)
' ** Argument Properties and Uses **
' args.Row("FieldName")
' args.Column, args.ProposedValue, args.Row
' Add Event Handler Code
' if iscode = true then
' return
' end if
' iscode = true
Select Case args.Column.ColumnName
Case "Character02"
SearchOnWhseBinAdapterFillDropDown(args.row)
End Select
'iscode = false
End Sub