What exactly is it that your are trying to do.
EVERY module that is instanced from PortalModuleBase or UserModuleBase inherits a property called ModuleId and one call PortalId plus lots of other stuff.
So for starters your MODULE must be declared as something like:
Namespace MyName.MyModules
Partial Class MyModuleClass
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Unless your module is setup this way then the control will not have direct access to the DNN system and context
- short of you hard coding a whole lot of ugliness.
From inside your module then:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim myLocalPortal as Integer = PortalId ' will have the PortalId
dim myLocalPortal as Integer = ModuleId ' will have the ModuleId
dim myUserInfo as UserInfo = Entities.Users.UserController.GetCurrentUserInfo ' will have the current userinfo
dim myUserId as Integer = myUserInfo.userId ' will have the current userid
and so on.
You should also possibly try to avoid using the asp.net data access tools - and instead use the DAL or DAL+ approach supported directly by DNN.
While I cant directly recall any conflicts between those elements and DNN - I guess its possible there may be one.
Westa