0

Hello,

Please help! I"ve created a form with three comboboxes and a datagrid. I've connect the comboboxes to the database and they all work but when i try and fill the datagrid based on the final selection from the last commbobox but it will not populate the datagridview..Help!

cmbVendor_MouseClick
Dim drv As DataRowView = cmbNatureCode.SelectedItem
Dim drv1 As DataRowView = cmbPort.SelectedItem
Dim drv2 As DataRowView = cmbVendor.SelectedItem
Dim port As String = drv1.Item("natureport").ToString
Dim ncode As String = drv.Item("naturecode").ToString
Dim vendor As String = drv2.Item("vendor").ToString
Dim da As New SqlDataAdapter("SELECT * FROM rates WHERE natureport = '" & port & "' and naturecode = '" & ncode & "' and naturecode = '" & vendor & "' ORDER BY vendor", conn)
Dim ds As New DataSet

da.Fill(ds, "rates")
ratesdataview.DataSource = ds.DefaultViewManager
conn.Close()
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by srice
0

Thank you, I figured it out it was my query...duh! "naturecode = '" & vendor & "' " it should have vendor = vendor!

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.