Protected Sub ddlstate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlstate.SelectedIndexChanged If ddlfin_year.SelectedIndex = 0 Then ClientScript.RegisterStartupScript(Me.GetType, "msgg", "alert('Please select Financial Year');", True) ddlstate.SelectedIndex = 0 Return End If If ddlmnth.SelectedIndex = 0 Then ClientScript.RegisterStartupScript(Me.GetType, "msgg", "alert('Please select Month');", True) ddlstate.SelectedIndex = 0 Return End If con.Open() Dim da As New SqlDataAdapter Dim dt As New DataTable Dim cmd As New SqlCommand Dim read As SqlDataReader cmd = New SqlCommand("Select Fin_Year,state_code,allocation from StateBrief_NSAP where Fin_Year='" & ddlfin_year.SelectedItem.Text & "' And state_code='" & ddlstate.SelectedItem.Value & "'", con) da = New SqlDataAdapter(cmd) dt = New DataTable() da.Fill(dt) read = cmd.ExecuteReader() read.Read() If dt.Rows.Count > 0 Then While read.Read Dim allocation As String = CStr(read("allocation")) Session("alloc") = allocation End While txtAllocation.Text = Session("alloc").ToString() txtAllocation.Enabled = False Else txtAllocation.Enabled = True txtAllocation.Text = "" End If read.Close() End Sub
txtAlloc.Text=Session("allocation").ToString()
Session("allocation")
ToString
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)