I have try to encrypt data bat i have problems ...
1. I have modify table UserDefinedData, FieldValue to varbinary(68)
2. procedure changes
USE [dbj_a]
GO
/****** Object: StoredProcedure [dbo].[UserDefinedTable_AddData] Script Date: 06/23/2008 18:11:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[UserDefinedTable_AddData]
@UserDefinedRowId int,
@UserDefinedFieldId int,
@FieldValue varbinary(68)
AS
INSERT INTO dbo.UserDefinedData
( UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (@UserDefinedFieldId, @UserDefinedRowId, EncryptByKey(Key_GUID('MyKey'), @FieldValue))
3. procedure changes
USE [db_a]
GO
/****** Object: StoredProcedure [dbo].[UserDefinedTable_GetRow] Script Date: 06/23/2008 18:16:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[UserDefinedTable_GetRow]
@UserDefinedRowId int,
@ModuleId int
AS
SELECT F.FieldTitle,
cast(DecryptByKey(D.FieldValue) as varchar(16)) as "FieldValue",
F.FieldType
FROM dbo.UserDefinedData D
INNER JOIN dbo.UserDefinedFields F on D.UserDefinedFieldId = F.UserDefinedFieldId
WHERE D.UserDefinedRowId = @UserDefinedRowId
AND F.ModuleId = @ModuleId
And I have this error while i try to add some data on dnn:
Error: Edit User Defined Table is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Operand type clash: ntext is incompatible with varbinary ---> System.Data.SqlClient.SqlException: Operand type clash: ntext is incompatible with varbinary at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues) at DotNetNuke.Modules.UserDefinedTable.SqlDataProvider.UpdateData(Int32 UserDefinedRowId, Int32 UserDefinedFieldId, String FieldValue) at DotNetNuke.Modules.UserDefinedTable.EditUserDefinedTable.cmdUpdate_Click(Object sender, EventArgs e) --- End of inner exception stack trace ---
Please what to do ?