Thanks for any insights you can help with!
Very simply, I'm calling a set of Contacts from the Database using LinqToSql. Two of those columns "FirstName" and "LastName" are encrypted.
I decrypt them on the fly as you see in the included code. However, I also want to filter based on LastName. The problem is if I do a compare in the statement, it's comparing the encrypted value to the text value.
I need to somehow get the resulting data for my gridview, then filter it after the fact, not based on the database values again, but with the data (and decrypted data) that I already have.
Ideas?? Thanks!
protected void ContactsLDS_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
DatabaseDataContext db = new DatabaseDataContext();
MyAES aes = new MyAES();
var v1 = from s in db.Contacts
select new Contact()
{
ContactId = s.ContactId,
FirstName = (s.FirstName == null ? "" : aes.DecryptString(s.FirstName)),
LastName = (s.LastName == null ? "" : aes.DecryptString(s.LastName)),
};
e.Result = v1;
}