Private Sub cb_product_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb_product.SelectedIndexChanged
Dim da As SqlDataAdapter
Dim ds As DataSet = New DataSet
Dim dt As New DataTable
Dim sqlcommand As String
sqlcommand = "SELECT product.pro_name,product.amount,product.price,serial.serial_number,status_product.product_ids FROM product INNER JOIN serial ON (product.pro_id = serial.product_id) INNER JOIN status_product ON product.pro_id = status_product.product_ids where statuss = 1 and product.pro_id = '" & cb_product.Text & "'"
da = New SqlClient.SqlDataAdapter(sqlcommand, SqlConnection1)
da.Fill(dt)
open_conn()
If dt.Rows.Count > 0 Then
txt_name.Text = dt.Rows(0)("pro_name")
txt_serial.Text = dt.Rows(0)("serial_number")
txt_price.Text = dt.Rows(0)("price")
txt_amount.Text = dt.Rows(0)("amount")
End If
End Sub
Tag : ASP.NET, Ms SQL Server 2005, Ms SQL Server 2008, VBScript, VB.NET, VS 2008 (.NET 3.x)