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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesSync New Database Column to Existing DNN Custom Module Sync New Database Column to Existing DNN Custom Module
Previous
 
Next
New Post
3/24/2014 2:54 PM
 

I inherited a DNN 7 app, and they want a new column added to a custom table.  I am able to do that, but how do I get DNN to recognize the schema change?  

The custom module is just an .ascx page, and it is only used in this application.  There is no version per se in the manifest.

Do I do something to the SQLDataProvider?

Update the .xsd file somehow?

Add something to the "controller" file they've created?

I am basically trying to get DNN to recognize database changes that I've made manually.  I feel like there is something I need to "run" to get DNN to pick up the changes....kind of like update-database in Entity Framework.

Thank you for any insight you can give me.

 

 
New Post
3/24/2014 5:41 PM
 
it depends on what's being used for data access -based on your mention of the controller, I'd guess they're using the DNN conventions in which case you just need to add a property for the new column into the *Info class that the *Controller methods get when they retrieve data - you'll also need to add the code that sets the new property to the database value. Most modern DNN code uses IHydratable (you can see an example of an *Info class populating with data at https://github.com/dnnsoftware/Dnn.Pl... ). However if you're new to DNN perhaps a read of the module development page and videos would be the best way for you to gain an understanding - http://www.dnnsoftware.com/wiki/page/...

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/24/2014 6:04 PM
 

Thank you for your quick reply.  

I wish they were using IHydratable.  It seems like even though this is DNN 7, none of the newer features are being used.  It's not the cleanest code I've seen, so I have had to stop thinking logically about anything I see....it's definitely a mashup.

Here is what I have determined....maybe someone will see something familiar.  Believe me, I have searched high and low for a simple answer (I have been coding for years).

User control (.ascx) saves a new "row" like this:

Instatiate:

EventsDataSet.u_EventsDataTable table = new EventsDataSet.u_EventsDataTable();

 

EventsDataSet.u_EventsRow row = table.Newu_EventsRow();


****

bunch fields to be saved

*** 

Then it calls this:

eventID = DataProvider.Instance().InsertEvent(row);


Which in turn accesses a DataProvider.cs, and the SQLDataProvider - both of which are in the App_Code folder. 


In hacking around, I was able to go into the .xsd file, which represented all the custom tables they've created.  Just for kicks, I added a new column.  I then went into the SQLDataProvider and manually added the field to the insert statement.

Somehow, this feels wrong.  At this point, I will take anything:  "Oh this is the way it used to be" or "Don't mess with stuff in the App_Code folder".    Even if you think it's vague - I might be able to search for something.


Btw, as far as the controller....one of the controller files does have a bunch of fields - like you would expect from a normal class.  The one that I'm working with does not.  



 
New Post
3/24/2014 6:32 PM
 
A DNN site is ASP .Net.

What you have there sounds like a common (not necessarily best) .Net 1.1 (ish) programming practise known as a 'strongly typed dataset'. I'd guess an ASP.Net developer simply used what he/she already knew.

Google strongly typed dataset and follow your nose.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/24/2014 6:55 PM
 

Yes, you are correct - this isn't a poster child for best practices.  I have been a .NET developer for a very long time, and datasets are definitely a blast from the past.  

I agree...I think I am just over thinking it....confusing what I think are DNN practices with just old crappy code.  There has been more than one occasion where I've said, why, why are they doing XXX this way?

Thanks!

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesSync New Database Column to Existing DNN Custom Module Sync New Database Column to Existing DNN Custom Module


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