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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Cannot retrieve items from databaseCannot retrieve items from database
Previous
 
Next
New Post
10/6/2008 8:21 AM
 

Hi all,

This is a strange problem that i can't seem to find a solution too.  Basically what i created was a blank module using the DotNetNuke Dynamic Module template.  For anyone who hasn't used this it generates a module which lets you add text in edit mode.  Each line of text is a seperate 'item'. 

All i wanted to do is add some extra fields to each item so that it would display a line of text and an image.  I Added an extra field in the sql to include an ntext field called imgUrl.  I updated the stored procedures and other classes generated by the template.

When i try to create a new item it does actually create a new item and the value for imgUrl is stored in the database.  It gets strange when i try to retrieve this value.  The text field is retrieved fine but the imgUrl field returns null.  Any ideas?  I've gone over and over the code but can't see anything wrong with it. 

Simon

heres the code that tries to load the values from the database:

              if (this.Request.QueryString["ItemId"] != null)
                {
                    ItemId = Int32.Parse(this.Request.QueryString["ItemId"]);
                }

                if (Page.IsPostBack == false)
                {
                    cmdDelete.Attributes.Add("onClick", " return confirm('" + Localization.GetString("DeleteItem") + "');");

                    if (ItemId != -1)
                    {
                        //get content
                        BestSellersController objBestSellerss = new BestSellersController();
                        BestSellersInfo objBestSellers = objBestSellerss.GetBestSellers(ModuleId, ItemId);
                        if (objBestSellers != null && objBestSellers.ImgUrl != null)
                        {
                            lblStatus.Text = "url: " + objBestSellers.ImgUrl + " contents: " + objBestSellers.Content;
                            txtUrl.Text = objBestSellers.ImgUrl;
                            txtContent.Text = objBestSellers.Content;
                            ctlAudit.CreatedByUser = objBestSellers.CreatedByUser.ToString();
                            ctlAudit.CreatedDate = objBestSellers.CreatedDate.ToString();                           
                        }
                        else
                        {
                            // ERROR: ImgUrl = null                          
                        }
                    }
                    else
                    {
                        cmdDelete.Visible = false;
                        ctlAudit.Visible = false;
                    }
                }

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Cannot retrieve items from databaseCannot retrieve items from database


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