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.0Unique Module ID?Unique Module ID?
Previous
 
Next
New Post
8/2/2007 11:59 AM
 



As far as dropping a module and it creating a unique id.
Here is the code I am using in the various necessary file:

SQLDATAPROVIDER
[ModuleId] [int] NOT NULL,

VB FILE
Protected Sub InsertingItem(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles
FormView1.ItemInserting
e.Values.Item("UserID"
) = Entities.Users.UserController.GetCurrentUserInfo.UserID
e.Values.Item("ModuleId"
) = ModuleId.ToString()
e.Values.Item("ID"
) = 0
End
Sub

INFO FILE
Public Property ModuleId() As
Integer
Get
Return
_ModuleId
End
Get
Set(ByVal value As Integer
)
_ModuleId = value
End
Set
End
Property



All values are being stored as "1", so I guess NOT NULL is working.
What am I missing to make sure Module ID's are being stored unique?


Feedback Appreciated,

-machina12

 
New Post
8/3/2007 4:55 AM
 

when you insert a new record in the Modules table, it will get a new ModuleID assigned automatically (the ModuleID field is an Identity field in the table). So if you want to create your modules in a diferent way, you would have to use that value. Please note that it might be dangerous to just start creating your own methods for adding modules to pages, as the logic in the core might change in future versions. You'd better use core routines for adding modules


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
8/3/2007 1:20 PM
 

I am familiar with primary keys, but where am I to dictate that the ModuleID will be an identity key?

Can change within SQL DATABASE > MODIFY TABLE, but that won't update stored procedures.

I included code above for each section, are you saying it looks good?  Or what is it missing to make it an identity key?


-machin12

 
New Post
8/4/2007 12:07 PM
 

maybe i just don't understand you at all. DNN creates module id's, they are created through the Modules table. Inserting a new module in a page creates a new record in that table, and a new moduleId is returned from the database. Why would you want to create your own unique module id's. Can you explain a bit more as to what it is you are exactly trying to accomplish here?


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
8/6/2007 11:43 AM
 

The problem is that the ModuleID & UserID are not being properly stored.

The primary key, running the ID column stacks numerically 1,2,3,4,5....
The module, no matter how many times it is dropped, is going is as ModuleID=1.
The UserID, no matter who is logged in, is going in as UserID=1

Using code from AdefWebServer tutorial, as posted above, should be storing values.
What am I missing to make each module it's own, as well as store info according to user?


Feedback Appreciated,

-machina12

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Unique Module ID?Unique Module ID?


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