• After more than 30 years running websites and forums I am retiring.

    I have made many friends through the years. I will cherish my time getting to know you. I wish you all the best. This was not an easy decision to make. The cost to keep the communities running has gotten to the point where it's just too expensive. Security certificates, hosting cost, software renewals and everything else has increased threefold. While costs are up ad revenue is down. It's no longer viable to keep things running.

    All sites will be turned off on Thursday 30 November 2023. If you are interested in acquiring any of the websites I own you can Email Schwarz Network.

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