Hi,
SelectedIndexChanged does NOT fired. Here is the code;
Any ideas?
Thanks in advance.
Best Regards
aspx
aspx.vb
SelectedIndexChanged
SelectedIndexChanged does NOT fired. Here is the code;
Any ideas?
Thanks in advance.
Best Regards
aspx
VB.NET:
....
<asp:Panel runat="server" ID="Panel3">
<table class="table">
<col class="table_left" />
<col class="table_right" />
<tr>
<td>
Bank<span class="red">*</span>
</td>
<td>
<asp:DropDownList ID="DropDownList_bank" runat="server">
</asp:DropDownList>
</td>
</tr>
.....
aspx.vb
VB.NET:
....
If Not Page.IsPostBack Then
If no= 5 Then
vendorNo = Convert.ToInt32(DetailsView1.Rows(0).Cells(1).Text)
Dim conn5 As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Try
Dim comm5 As New Data.SqlClient.SqlCommand("SELECT Bank,No,IBAN FROM Accounts WHERE name like '%" + vendorNo.ToString + "%'", conn5)
Dim SQLSelectAdapter5 As New SqlDataAdapter()
SQLSelectAdapter5.SelectCommand = comm5
conn5.Open()
Dim dt5 As New DataTable
SQLSelectAdapter5.Fill(dt5)
If dt5.Rows.Count > 0 Then
'SQLSelectAdapter5.Dispose()
DropDownList_bank.DataSource = dt5
DropDownList_bank.DataTextField = "Bank"
'DropDownList_bank.DataValueField = "Bank"
DropDownList_bank.DataBind()
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
loggerDB.Error(ex.Message, ex)
Finally
'Close the connection
conn5.Close()
End Try
SelectedIndexChanged
VB.NET:
Protected Sub DropDownList_bank_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList_bank.SelectedIndexChanged
Dim conn5 As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Try
Dim comm5 As New Data.SqlClient.SqlCommand("SELECT Bank,No,IBAN FROM Accounts WHERE name like '%" + Me.ViewState("vendorNo").ToString + "%' and Bank = '" + DropDownList_bank.SelectedItem.Value+"'", conn5)
Dim SQLSelectAdapter5 As New SqlDataAdapter()
SQLSelectAdapter5.SelectCommand = comm5
conn5.Open()
Dim dt5 As New DataTable
SQLSelectAdapter5.Fill(dt5)
If dt5.Rows.Count > 0 Then
SQLSelectAdapter5.Dispose()
DropDownList_bank.DataSource = dt5
DropDownList_bank.DataTextField = "Bank"
DropDownList_bank.DataValueField = "Bank"
DropDownList_bank.DataBind()
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
loggerDB.Error(ex.Message, ex)
Finally
'Close the connection
conn5.Close()
End Try
....