Reputation: 3755
we are using data sets as our data access layer. currently there are some columns that store encrypted data.
using CLR i was able to create an SQL function for decryption of the data in a select but in discussion we have determined that to be a security risk.
what i am looking to do is to either
Upvotes: 2
Views: 1054
Reputation: 2161
You may try to create an extension methods for this task:
namespace ExtensionMethods
{
public static class MyExtensions
{
public static void SetEncryptColumn(this DataSetType.DataTableRow row, string value)
{
row.Encrypt = EncryptValue(value);
}
public static string GetEncryptColumn(this DataSetType.DataTableRow row)
{
return DecryptValue(row.Encrypt);
}
}
}
http://msdn.microsoft.com/en-us/library/bb383977%28v=vs.90%29.aspx
Upvotes: 2
Reputation: 131180
Typed DataTables are partial classes. While you can't override a property, you can add more methods in another file that will encrypt on set and decrypt on get, storing the values in the original properties.
Upvotes: 0