Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListUpdating table programmaticallyUpdating table programmatically
Previous
 
Next
New Post
3/9/2009 7:07 PM
 

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.

 

 

 
New Post
3/10/2009 3:47 AM
 

do not create a UserDefinedData row for Null values.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListUpdating table programmaticallyUpdating table programmatically


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out