You will have to excuse me as I am new to Dot Net Nuke and I am still finding my way round.
I am using the latest version of Dot Net Nuke
I have created a page with a UDT Module in the Content Pane. My table contains 8 HTML Columns.
The 1st, 3rd, 5th and 7th columns contain rich text in the format:
<img src="http://......jpg" width="70" border="0" title="Product Title" alt="Alt Tag Product Title"/>
The 2nd, 4th, 6th and 8th columns contain rich text in the format
<table><tr><a title="Product Title" href="http://....">Title</a> </tr> <tr> <a title="Product Title" href="http://...">Amount</a></tr></table>
I have a stored procedure that performs the inserts for me, which allows me to insert data with different values as shown below:
create procedure [dbo].[insertUserDefinedData]
@Column int,
@BrandName nvarchar(128),
@ImageURL nvarchar(128),
@ProductName nvarchar(128),
@ProductURL nvarchar(128),
@Price nvarchar(128)
as
begin
declare @iRowId int
if @Column = 1
begin
insert into UserDefinedRows (ModuleId) Select ModuleId From Modules where ModuleTitle = @BrandName
select @iRowId = @@IDENTITY
insert into UserDefinedData values (1, @iRowId, '2009-03-09T20:46:10')
insert into UserDefinedData values (2, @iRowId, 'SuperOpakapaka')
insert into UserDefinedData values (3, @iRowId, '2009-03-09T20:46:10')
insert into UserDefinedData values (4, @iRowId, 'SuperOpakapaka')
select 'Column 1' + str(@iRowId)
end
else
begin
select @iRowId = MAX(UserDefinedRows.UserDefinedRowId) FROM UserDefinedRows
select 'Column 2 3 4' + str(@iRowId)
end
declare @sql nvarchar(1024)
select @sql = '<img src="' + @ImageURL + '" width="70" border="0" title="' + @ProductName + '" alt="' + @ProductName + '"/>'
insert into UserDefinedData values (@Column + 4, @iRowId, @sql)
select @sql = '<table><tr><a title="Click here to buy ' + @ProductName + '" href="' + @ProductURL + '">' + @ProductName + '</a> </tr> <tr> <a title="Click here to buy ' + @ProductName + '" href="' + @ProductURL + '">£' + @Price + '</a></tr></table>'
insert into UserDefinedData values (@Column + 8, @iRowId, @sql)
end
go
The stored procedure runs successfully, and data is successfully inserted into the database.
So when I reload the web page, when logged on as an administrator, I click on the edit icon. I get the following error message:
Error: is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Conversion from type 'DBNull' to type 'String' is not valid. ---> System.InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid. at Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) at DotNetNuke.Modules.UserDefinedTable.Editform.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---
All the data in the UserDefined tables looks fine.
Can someone shed any light on this problem. I would be very grateful for any suggestions.