say i have a table which has a text column call "Name". i want to be able to intercept and modify the value of that field (decrypt it via a function) before it displayed on the various list and edit DD forms
Hi Jress, the simplest solution is to create a custom field template.
To Jress:)
MVP has offered you a concept idea of a solution to your problem, and about how to create a Custom field in Dynamic Data, maybe you should have a look at:
Member
11 Points
56 Posts
intercepting a column value read from the database and modifying
Jun 27, 2012 07:53 AM|jrees|LINK
say i have a table which has a text column call "Name". i want to be able to intercept and modify the value of that field (decrypt it via a function) before it displayed on the various list and edit DD forms
what is the best way of achieving this?
thanks in advance
john
Star
9210 Points
2981 Posts
Re: intercepting a column value read from the database and modifying
Jun 27, 2012 09:27 AM|Mudasir.Khan|LINK
is the decryting logic possible in SQL Server then decrypt and return the the column in select clause
else
when you are adding the properties to the model assign to the property in turn it decrypts and have a porperty to get the Decrypted value
Participant
860 Points
206 Posts
Re: intercepting a column value read from the database and modifying
Jun 27, 2012 09:32 AM|Perkinsville|LINK
Hi,
I would try and do that with a stored procedure on the database side and not on a client or webserver. Just my 2 cents.
HTH, Ben
Member
11 Points
56 Posts
Re: intercepting a column value read from the database and modifying
Jun 27, 2012 09:40 AM|jrees|LINK
no the decrypting cannot be done sql server unfortunately
"when you are adding the properties to the model assign to the property in turn it decrypts and have a porperty to get the Decrypted value"
can you give me an example?
Star
9210 Points
2981 Posts
Re: intercepting a column value read from the database and modifying
Jun 27, 2012 09:46 AM|Mudasir.Khan|LINK
public string pwd = string.Empty;
public string epwd = string.Empty;
public string Password
{
get
{
return pwd;
}
set
{
epwd=value;
pwd=decrypt(value);
}
}
public string EPassword
{
get
{
return epwd;
}
set
{
epwd=value;
}
}
Member
11 Points
56 Posts
Re: intercepting a column value read from the database and modifying
Jun 27, 2012 09:58 AM|jrees|LINK
ok thanks i'll give that a go
All-Star
17915 Points
5679 Posts
MVP
Re: intercepting a column value read from the database and modifying
Jun 28, 2012 08:08 AM|sjnaughton|LINK
Hi Jress, the simplest solution is to create a custom field template.
Always seeking an elegant solution.
All-Star
94120 Points
18111 Posts
Re: intercepting a column value read from the database and modifying
Jun 28, 2012 10:14 PM|Decker Dong - MSFT|LINK
To Jress:)
MVP has offered you a concept idea of a solution to your problem, and about how to create a Custom field in Dynamic Data, maybe you should have a look at:
http://msdn.microsoft.com/en-us/library/cc488522.aspx