i have an encrypted column in my database table and the dynamic data ignores them how can i make encrypted columns to appear in my grid (read only). i also have a stored procedure to decrypt the column but how do i use it in a custom page.
Hi Rosalind, Not fully clear on what you have, so let me ask are you using Linq to SQL (L2S) or Entity Framework (EF) in your project and are you asking:
How to display the Encrypted Column?
How to use the SPROC?
For 1 what is the DB column type?
well get to two once you have replied [:)]
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
i'm usin l2s and i want to know how to display the encrypted column using stored procedure. my stored procedure is as follows ALTER PROCEDURE [dbo].[Pr_tbl_PaymentMaster_Get] AS BEGIN SELECT PaymentMaster_Id ,PaymentType_Id ,PaymentMaster_ShortName ,PaymentMaster_Desc
,PaymentMaster_MerchantId ,CONVERT(NVARCHAR(100),DECRYPTBYPASSPHRASE('p@ssw0rd@1',PaymentMaster_CheckSum,1)) AS PaymentMaster_CheckSum ,PaymentMaster_RequestURL ,PaymentMaster_ResponseURL ,PaymentMaster_IsActive ,PaymentMaster_IsDeleted FROM dbo.tbl_PaymentMaster
END
I would create a Custom page and manually setup the LinqDataSource probably using the OnSelecting event. If you are using Visual Studio 2010 and .Net 4 the you could use the Domain Service and this would allow you to call your SPROC instead of the normal
Linq methods, as there seems to be no way of mapping the LinqDataSource to a SPROC or Table Valued Function.
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
None
0 Points
3 Posts
how to display encrypted columns in dynamic data
Jun 07, 2010 06:16 AM|rosalind|LINK
i have an encrypted column in my database table and the dynamic data ignores them how can i make encrypted columns to appear in my grid (read only). i also have a stored procedure to decrypt the column but how do i use it in a custom page.
All-Star
17916 Points
5681 Posts
MVP
Re: how to display encrypted columns in dynamic data
Jun 07, 2010 07:45 AM|sjnaughton|LINK
Hi Rosalind, Not fully clear on what you have, so let me ask are you using Linq to SQL (L2S) or Entity Framework (EF) in your project and are you asking:
For 1 what is the DB column type?
well get to two once you have replied [:)]
Dynamic Data
Always seeking an elegant solution.
None
0 Points
3 Posts
Re: how to display encrypted columns in dynamic data
Jun 07, 2010 09:03 AM|rosalind|LINK
i'm usin l2s and i want to know how to display the encrypted column using stored procedure. my stored procedure is as follows ALTER PROCEDURE [dbo].[Pr_tbl_PaymentMaster_Get] AS BEGIN SELECT PaymentMaster_Id ,PaymentType_Id ,PaymentMaster_ShortName ,PaymentMaster_Desc ,PaymentMaster_MerchantId ,CONVERT(NVARCHAR(100),DECRYPTBYPASSPHRASE('p@ssw0rd@1',PaymentMaster_CheckSum,1)) AS PaymentMaster_CheckSum ,PaymentMaster_RequestURL ,PaymentMaster_ResponseURL ,PaymentMaster_IsActive ,PaymentMaster_IsDeleted FROM dbo.tbl_PaymentMaster END
All-Star
17916 Points
5681 Posts
MVP
Re: how to display encrypted columns in dynamic data
Jun 07, 2010 09:23 AM|sjnaughton|LINK
OK Rosalind, your problem here is that there is no way to use a stored procedure SPROC to Select data with Linq to SQL [:(]
You cam map a SPROC or Table Valued Function to a method and call that but that will not help with Dynamic Data easily see LINQ to SQL (Part 6 - Retrieving Data Using Stored Procedures).
I would create a Custom page and manually setup the LinqDataSource probably using the OnSelecting event. If you are using Visual Studio 2010 and .Net 4 the you could use the Domain Service and this would allow you to call your SPROC instead of the normal Linq methods, as there seems to be no way of mapping the LinqDataSource to a SPROC or Table Valued Function.
Dynamic Data
Always seeking an elegant solution.