16
Answers

DropDownList

Aman Jen

Aman Jen

11y
1.1k
1
Hi,
   I have 2 DropDownlistBox in Front end

DP1
DP2

2 TextBoxes, Which Should Show Data based on Selected Item from DP2 on Button Click event

2 SqlDb Table Joined by common Column Loan_code, 
 
Bank1
Bank2

DP2 shows Item Based on Item selected From DP1..till here its working fine, But, show just first record...

Below is my code ...

Public Sub ShowData()
        cmd.Connection = cn
        cmd.CommandText = "Select Bank1.Loan_type , Bank2.Curt_EMI FROM Bank1 INNER JOIN  Bank2 ON Bank1.Loan_code = Bank2.Loan_code"
        Dim dr As SqlDataReader
        dr = cmd.ExecuteReader()
        If dr.HasRows Then
            dr.Read()
            tb1.Text = dr.Item("Loan_type").ToString
            tb2.Text = dr.Item("Curt_EMI").ToString
        End If
    End Sub

Join query is working fine in sqlDB Environment, But in frontend it is fetching just one record


Plz Help
Answers (16)