This is my select SQL syntax to display the category choices, but what I need to do is display the corresponding category chosen based on equipment_id
I got 2 tables, tblOfficeEquipmentCategory and tblOfficeEquipmentProfile
I need to inner join tblOfficeEquipmentProfile so I can add the WHERE equipment_id = '"txtid.text"'
What would be the corresponding SQL syntax
Public Sub DisplayCategory()
'based on oe_id
Dim sqlconn As New SqlClient.SqlConnection
sqlconn.ConnectionString = "server = SKPI-APPS1;" & _
"Database = EOEMS;integrated security=true"
Dim sqlcommand As SqlCommand
sqlconn.Open()
Dim da As New SqlDataAdapter("select * from tblOfficeEquipmentCategory", sqlconn)
Dim dt As New DataTable
da.Fill(dt)
cmbCategory.DataSource = dt
cmbCategory.ValueMember = "CAT_Name"
cmbCategory.DisplayMember = "CAT_ID"
sqlconn.Close()
End Sub
See Question&Answers more detail:os