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
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE