Public Class DynamicForm
Private dsNCICriteria As New DataSet
Private Sub DynamicForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Capture data for NCI Criteria Combo Boxes
Dim conStringNCICriteria As String = "removed string;"
Dim strSQLNCICriteria As String = "select ntypeid,grade,cast(grade as nvarchar) + ' - ' + description as description " + _
"from nci_criteria"
Dim conNCICriteria As New SqlConnection(conStringNCICriteria)
Dim daNCICriteria As New SqlDataAdapter(strSQLNCICriteria, conNCICriteria)
daNCICriteria.Fill(dsNCICriteria, "NCICriteria")
daNCICriteria.Dispose()
conNCICriteria.Close()
conNCICriteria = Nothing
strSQLNCICriteria = Nothing
conStringNCICriteria = Nothing
End Sub
Sub responseChkBoxEvents(ByVal sender As System.Object, ByVal e As System.EventArgs)
If chk.Checked = True Then
If chk.Name.Substring(chk.Name.LastIndexOf("N") + 1) <> 0 Then
Dim nciTypeID As String = chk.Name.Substring(chk.Name.LastIndexOf("N") + 1)
Dim nciFilter As String
nciFilter = "ntypeid = " + chk.Name.Substring(chk.Name.LastIndexOf("N") + 1)
Dim cbo As ComboBox = TryCast(Me.Controls(Replace(Replace(chk.Name, "CHK", "NCICBO"), "L" + z.ToString, "L" + (z + 1).ToString)), ComboBox)
With cbo
.DataSource = dsNCICriteria.Tables("NCICriteria").Select(nciFilter)
.DisplayMember = "description"
.ValueMember = "grade"
.Visible = True
.SelectedItem = Nothing
.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
.AutoCompleteMode = AutoCompleteMode.Append
End With
End If
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.