plz check my code and tell me why dropdown binds two times and loop for year is running 2 times and in catch an error is thrown :connection is not closed..what the error in this code,i can't detect exactly where the problem is...plz check and reply me
Imports System
Imports System.Data
Imports system.Data.SqlClient
Partial Class sel_dist
Inherits System.Web.UI.Page
Dim str As String = System.Configuration.ConfigurationManager.AppSettings("constr")
Dim str1 As String = System.Configuration.ConfigurationManager.AppSettings("constr")
Dim con As New SqlConnection(str)
Dim dr As SqlDataReader
Dim cmd As New SqlCommand
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If yrdd.SelectedIndex <> 0 Then
If distdd.SelectedIndex <> 0 Then
If blockdd.SelectedIndex <> 0 Then
...
Go to the complete details ...