asked on
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
ASKER
ASKER
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
.DataSource = dsNCICriteria.Tables("NCIC
with
.dsNCICriteria.Tables("NCI
.DataSource = dsNCICriteria.Tables("NCIC