FST.Text = dr("FST").ToString()
FST_ID.Text = dr("FST_ID").ToString()
' If FST.Text <> "" Then
Dim sFST As String = FST.Text
Dim iFST_ID As String = FST_ID.Text
Call GetDropDown(sFST, iFST_ID)
Public Sub GetDropDown(ByVal FST As String, ByVal FST_ID As String) Dim constr As String = ConfigurationManager.ConnectionStrings("xxx").ConnectionString Using con = New SqlConnection(constr) Try Dim cmd As SqlCommand = New SqlCommand() With cmd .Connection = con .Connection.Open() .CommandText = "spANF_GET_FIBRE_SOLUTION_TYPE" .CommandType = CommandType.StoredProcedure End With Using dr As SqlDataReader = cmd.ExecuteReader() If dr.HasRows Then ddlFST.DataSource = dr ddlFST.DataTextField = "FST" ddlFST.DataValueField = "FST_ID" ddlFST.DataBind() ' ddlFST.Items.Insert(0, New ListItem("--Select Item--", "0")) ' Dim iFST_ID1 As String = Request.Form(ddlFST.UniqueID) If (ddlFST.Items.Count > 0) Then ddlFST.Items.FindByText(FST).Selected = True ddlFST.Items.FindByValue(FST_ID).Selected = True Else ddlFST.Items.Insert(0, New ListItem("--Select Item--", "0")) ddlFST.SelectedIndex = 0 End If End If End Using con.Close() Catch ex As System.Data.SqlClient.SqlException Dim msg As String = "Fetch Error:" msg += ex.Message Throw New Exception(msg) Finally con.Close() End Try End Using End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.