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.0PLEASE HELP:Script to automatically create multiple tables/fields in multi-module custom applicationPLEASE HELP:Script to automatically create multiple tables/fields in multi-module custom application
Previous
 
Next
New Post
9/5/2009 12:39 PM
 

Greetings to all!

To introduce myself, I am a wife of a programmer.  Husband is a salaried coder/corporate fire extinguisher/password retriever by day and a freelance coder/domestic fire extinguisher/objects on high shelves retriever at night.  I'm a wife that knows enough about the "other side" to be dangerous but not enough to be an effective addition to a struggling, "side job" family business.

With that being said, I am seeking advise on a little problem that I believe that we have, but he probably doesn't think of it as much of a problem but more of an inconvenience.  However, it's driving me bonkers.  It's probably easier for me to ask a random question in a forum than to ask him and actually get my point across! 

So, here it goes.  Husband has developed an extremely awesome and intricate custom application for a client of ours.  It uses two seperate forms (individual modules) to collect several different categories of information.  Then there are an additional two modules that are used on the "back end" (security roles allowing only employees to use these modules) that allow for the editing of the information collected and for the matching of one set to the other.  

Due to the complexity of this custom (multi-moduled) application, there are several (lots and lots and lots) of custom built tables with about a bazillion columns in each.  As it stand currently, the only good production environment for this application is on my husband's computer.  This is because, in order for me to get the production environment working on my computer, I wouldn't have to go and manually create every one of these tables in the database.  You know what!  I really don't want to do that.  I really don't think that I NEED to do that.  There must, MUST be a way that a script can be included in the packaging of the module that would AUTOMATICALLY create the tables upon installation of the module definition.  Now, the part that would appear to me (the novice here) as complicated is that there are multiple modules that use the same tables.  I would think there would have to be an if/then statement that would look to see if the table existed and obviously created it only if it didn't already exist.

Now, this brings me to the next part of the question.  If we are working on the application and need to make changes to the database structure (add a table, add or change a column name, etc.), I would imagine that the only way to make that update would be through "updating" the module through versioning.  I'm sure there are resources available that would explain that in simple enough terms that would prove worthwile to do it.

My biggest disadvantage here is that I'm not a coder myself and I can't just go in and do it.  I have to convince the husband to do it.  He doesn't think it's worth it, but I believe that this appilcation can be expanded upon greatly and could eventually produce enough revenue for me to spend real money in exchange for virutual money in online games or even pay some real life bills.  Either way, I think there is some real potential but I'd at least like to be able to have this application packaged neatly and properly.

ANY advice on how to make this happen easily and efficiently would be soooooo greatly appreciated.  I have looked for the DNN Module Developer's documentation, but much to my dismay, I don't see it on the downloads page any more.  However, if you could give me some "customized" advice as opposed to referring me to external documentation, I would be thrilled.  I look forward to your responses.

Chrissi - the coder's "dangerous" wife

 

 
New Post
9/5/2009 3:18 PM
 

 I should probably note that we're using VB.NET...just a minor detail!  

 
New Post
9/5/2009 5:22 PM
 

You missed out on a few details such as versions, so I will assume SQL Server 2008 Express. Managing yoiur SQL database, modifying tables and fields and generating scripts is quite easy using SSMS (SQL Server Mangement Studio).

SSMS Express
http://www.microsoft.com/DownLoads/details.aspx?familyid=08E52AC2-1D62-45F6-9A4A-4B76A8564A2B&displaylang=en

Here are some sample instructions (for SQL 2005)
http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/

The only caveat is adding objectQualifier to your scripts for DotNetNuke. Generally you can use a find/replace make SSMS scripts DotNetNuke compatible. Finally I would recommed completing version 1.0 and generate the database script only when you are ready to publish your module. Change scripts are very difficult to maintain and cause versionitis headaches.

I hope this is of some help to you.


Dwayne J. Baldwin
 
New Post
9/6/2009 12:00 PM
 

Dwayne Baldwin wrote

You missed out on a few details such as versions, so I will assume SQL Server 2008 Express. Managing yoiur SQL database, modifying tables and fields and generating scripts is quite easy using SSMS (SQL Server Mangement Studio).

SSMS Express
http://www.microsoft.com/DownLoads/details.aspx?familyid=08E52AC2-1D62-45F6-9A4A-4B76A8564A2B&displaylang=en

Here are some sample instructions (for SQL 2005)
http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/

The only caveat is adding objectQualifier to your scripts for DotNetNuke. Generally you can use a find/replace make SSMS scripts DotNetNuke compatible. Finally I would recommed completing version 1.0 and generate the database script only when you are ready to publish your module. Change scripts are very difficult to maintain and cause versionitis headaches.

I hope this is of some help to you.

 

Thanks for your response. I'm a little confused about something though.  To which database would this be referring?  Would it need to include scripts for several types of databases?  I would assume that it would ultimately depend on whatever the hosting servers were running.  

Currently, they way it works is that we add the tables and then install the modules.  I would like to just create the PA files and do in all in one swoop, having the modules do the table creating.  

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0PLEASE HELP:Script to automatically create multiple tables/fields in multi-module custom applicationPLEASE HELP:Script to automatically create multiple tables/fields in multi-module custom application


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