Last post Jun 07, 2010 09:23 AM by sjnaughton
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.
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 [:)]
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
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.