fill textboxes with data from a table

leonel

Newcomer
Joined
Nov 12, 2012
ok, i got this windows form, with one combobox control and 4 texboxes
what i want to acomplish is to populate the texboxes with data from the table, base on the selected item from the combobox.
example.
table name: RMA_Transactions
Fields: Rma_Number, Supplier, Device,Model, Serial_Number
the Rma_number is display on the combobox, no problem there for me.
this is the code to populate the combobox"

Private Sub Receive_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

Dim con As New SqlConnection(" Data Source=GX520B;Initial Catalog=ReturnEquipment;Integrated Security=True")
Dim cmd As New SqlCommand("Select rma_number FROM dbo.Rma_Transactions")
cmd.Connection = con
Dim da As New SqlDataAdapter
Dim ds As New DataSet
da.SelectCommand = cmd
ds.Clear()
da.Fill(ds, "dbo.Rma_Transactions")
CbReceive.DataSource = ds.Tables("dbo.Rma_Transactions")

CbReceive.DisplayMember = "rma_number"



End Sub



The help I need is getting the texboxes to display the data.
 

leonel

Newcomer
Joined
Nov 12, 2012
i remove the textboxes and drop a datagridview instead, now i would like to populate the datagridview base on the selection from the combobox.
 
Top Bottom