Posted on: 5/7/2012 4:22:26 PM | Views : 298

Hi,
I have a DropDownList (DDL1) that is populated from a SQL query on the server side.  Basically my SQL query selects three columns; FirstName, LastName, UserID.  However, the data in those columns is encrypted and needs to be decrypted at DDL1 DataBound.
Also, I want to combine the FirstName and LastName as follows:  FirstName + " " + LastName AS Name.
My end result should populate the DDL1 as follows:  DataTextField = Name;  DataValueField = UserID.
How do I query my database, apply my decryption process to the data, then bind it to my DDL1?
Here is my code:
Dim ConnToList As String = ConfigurationManager.ConnectionStrings("String").ToString() Dim sqlStrToList As String = "SELECT [FirstName] + ' ' + [LastName] AS [Name], [UserID] FROM Table1" Dim dtToList As New DataTable Dim dataAdapterToList As New SqlClient.SqlDataAdapter(sqlStrToList, ConnToLi ...

Go to the complete details ...