I appreciate all the support possible,
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
utilizador.Text = Me.Context.User.Identity.Name
If (Not IsPostBack) Then
escolhePerfil()
End If
End Sub
Function escolhePerfil() As Boolean
Dim connstring As String = "Data Source=10.2.24.17;Persist Security Info=True;User ID=sa;Password=11111;database=22222"
Dim SQLData As New System.Data.SqlClient.SqlConnection(connstring)
Dim cmdSelect As New System.Data.SqlClient.SqlCommand("i hide") 'if u need that just tell me
SQLData.Open()
Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader()
If dtrReader.HasRows Then
DropDownPerfil.DataValueField = "Description"
DropDownPerfil.DataSource = dtrReader
DropDownPerfil.DataBind()
End If
SQLData.Close()
Return True
End Function
Protected Sub DropDownPerfil_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownPerfil.SelectedIndexChanged
lbperfil2.Text = DropDownPerfil.SelectedValue
' lbnome.Text = DropDownPerfil.SelectedValue
End Sub
this is the .aspx
<asp:DropDownList ID="DropDownPerfil" runat="server" Height="16px" Width="202px"
CssClass="DropBorderColor" AutoPostBack="True">
</asp:DropDownList>

New Topic/Question
Reply



MultiQuote







|