i have created one database in which there is one table Supplier, its primary key is SCode. i have one more table Quotation, in which i have created SCode as Foreign Key.nw i want to allow user to select SCode from Combobox in Quotation table. Format. hw 2 add databinding to a combo. when i create it as
where dv is obj of DataView. t displays only one SCode which is th first record in SCode.
i.e there is only one item in Combo.
when i put above code in Loop, as
Dim ds As DataSet Dim s As String = "SELECT SupCode From supplier" Dim a As New OleDbDataAdapter(s, connquot) ds = New DataSet a.Fill(ds, "Supplier") Dim v As New DataView(ds.Tables("Supplier")) Dim c As CurrencyManager c = CType(Me.BindingContext(v), CurrencyManager) Dim i As Integer c.Position = 0 combobox1.DataBindings.Clear() For i = 0 To c.Count ComboBox1.DataBindings.Add("text", v, "SupCode") c.Position += 1 Next
it displays error of two data bindings in item of combo.
hw 2 move from one ComboBox.Item(0) to ComboBox.Item(1) to another and hw 2 add data as DataBindings .
thnks in advance
Edited 3 Years Ago by mike_2000_17: Fixed formatting