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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0beginner qu.beginner qu.
Previous
 
Next
New Post
5/10/2007 3:12 AM
 

Hi all, first post..

I've been thrust into DNN with zero background in ASP/.Net/C# etc (but 15 years in C++/Java).

To cut to the chase, I'm modifying the C# version of Michael Washington's ThingsForSale example module, purely as a beginner's introduction to DNN. I have the C# example module running fine, and so decided to make my own (even simpler!) one. I just have a Business Object/"Controller" class (with a single Select method corresponding to a stored procedure in my DB) and Data Object/"Info" class, and the relevant UI/code-behind in which I have an ObjectDataSource bound to my own DB , and a GridView attached to that.

When my GridView populates, only 3 columns populate; two varchar[255] columns and an int column. The other varchar columns and datetime columns do not.

After much experimenting I have found that most of the setters in my "Info" class are not getting called; only 3 are getting called, which means only those properties are getting values. When the getters of those properties are called (when populating the grid) of course the values are null at that point, so the grid displays nothing in those cases.

Because I'm a noob in several areas at once, I'm finding it hard to locate where my problem lies. I've searched the forums here and elsewhere.

I'll post some code if need be, but I'll wait and see if there's a quick solution from someone on the forum first.

Thanks in advance.. hope this makes sense.

 

 
New Post
5/10/2007 7:29 AM
 

I'm assuming that your controller class uses uses CBO.FillCollection, CBO.FillObject, etc. I'd first check that the column names returned by your stored procedure EXACTLY match the names of the corresponding properties in the info class and the names provided in the DataField properties of each column of the Gridview.  Also, make sure that the properties of the info class are NOT Readonly and that they are not marked Private. You might also want to execute the stored proceedure in your database management software and double check that all columns are being returned at that point. If these suggestions don't get you to the problem, post some code - the stored procedure, info class (one of the properties that is returning data and one that is not), the controller class method that is not working, the set up of the ObjectDataSource, and the declaritive markup code for the GridView.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
5/10/2007 8:57 AM
 

Also, since that tutorial was created we now recommend that you do not use the CBO. See:

A Custom Hydrator for your Module

While doing it this way is a bit more code, it has better performance and may be EASIER for you to figure out what problems you are having. Also for more C# code see: C# Version of the Survey Module and more C# examples here: http://www.adefwebserver.com/DotNetNukeHELP/



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
5/10/2007 9:00 PM
 

Awsome and quick response! That was the solution (i.e. column names not exactly matching property names).

Damn, always seems obvious when you know

Thanks again!!

PS: quick off-topic question.. are the Express versions (i.e. VWD, VC#) massively cut-down over the full versions? I've seem some comparative charts but they don't seem to mention things like refactoring options (I've been spoilt with some nice *cough* Java *cough* tools but I'm not sure if the MS tools are up to the same level in that area. For instance, manually *ugh* typing in my data object/"Info" class from above! Couple of clicks and I would've had getters/setters for all my properties in my old dev tool!).

 
New Post
5/10/2007 9:02 PM
 

Thanks Michael will check out those resources!

Again, love the quick responses, keep up the good work

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0beginner qu.beginner qu.


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