G'day
I'm finally moving my DB from access to SQL - but joy to the world I need to write a new GUI. I'm getting there. It's a lot easier than I imagined.
I don't quite understand how I can retrieve values from my select query to place them into textboxes.
I think I have a basic understanding of it, but could someone tell me if I'm thinking the wrong way?
I need to dim the variables I want to receive from the select query 1st.
I need to run the SQL query to receive the values required after the where clause.
But, how do I reference the values to put them into the variables, which would then show I the textboxes.
Basically it's a repairs database that has a Primary Key (the RA) and it will only ever bring across one result.
On combobox.selectedindexchanged, it needs to run through the sql query that I've typed in and then it needs to be put into the variables.
I'm thinking the values would be stored as qrystr.row or something of that nature? Am I correct?
What I have so far is below
Private Sub RA_IDComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RA_IDComboBox.SelectedIndexChanged
Dim connectionstring As New SqlConnection(Main.connectionstring)
Dim qrystr As String = "SELECT RA.RA_ID, RA.Till_ID, HardwareType.TillType, RA.Date_S, RA.Date_R, RA.Quote, RA.Accept, Supplier.Supplier, RA.Our_Cost, RA.Price, Customer.Company, " & _
"Courier.CourCompany, RA.SendCon, RA.FixCon, RA.HIssue" & _
"FROM Courier INNER JOIN " & _
"RA ON Courier.CourierID = RA.CourCompany INNER JOIN" & _
"Customer ON RA.Company = Customer.CustomerID INNER JOIN" & _
"Supplier ON RA.Supplier = Supplier.SupplierID INNER JOIN" & _
"HardwareType ON RA.TillType = HardwareType.ID" & _
"WHERE (RA.RA_ID = N' " & RA_IDComboBox.Text & "')"
Dim TillID As String
Dim tilltype As String
Dim customer As String
Dim dates As String
Dim supplier As String
Dim courier As String
Dim sendcon As String
Dim hissue As String