Thank you for the wonderful explanation! Everything worked like charm except I don't know how to update my database from the selection in the drop down.
I am loading information into the datagridview and want the combobox to populate based on what is already saved, and also allow user to select a new option. How do I commit the change made from the drop down? I feel like the answer is obvious... sorry if it is! I am new to VB.NET... most of my experience is with VB.6... trying to move into the future.
Code Code:
Dim SQL As New SQLControl Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Me.BindingSource2.DataSource = Me.GetParentTable() Me.Column1.DisplayMember = "List_Item" Me.Column1.ValueMember = "Data_code" Me.Column1.DataSource = Me.BindingSource2 Me.BindingSource1.DataSource = Me.GetChildTable() Me.DataGridView1.DataSource = Me.BindingSource1 End Sub Private Function GetParentTable() As DataTable Dim table As New SQLControl table.ExecQuery("SELECT * from dropdownlist WHERE list_name = 'Renewal'") Return table.DBDT End Function Private Function GetChildTable() As DataTable SQL.AddParam("@prophmy", 637) SQL.AddParam("@budgetid", globalBudgetID) SQL.ExecQuery("SELECT Amendment_Type Amendment, Amendment_Status Status, Units, Lease_Type 'Lease Type', Commence_Date 'Begin Date', Expiration_date 'End Date', Leased_sf 'Leased SF', lease_hmy, tenant_hmy, prop_hmy, budget_id, renewal_type " _ + " FROM lease WHERE budget_id = @budgetid And prop_hmy = @prophmy ORDER BY sequence") Return SQL.DBDT End Function





Reply With Quote