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
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE