OK - this is making my brain hurt ... lets see.
( ASP.NET classes 101 )
The contents of files in the \App_Code\ directory are all based around standard asp.net CLASS definitions.
That is - they define a class that can be used - anywhere in the website. You can put any class you want in a .vb in this area - and it will always be compiled and made available to the rest of your site.
A class definition is a block of code - that defines the structure and implementation of a object. THey contain properties and methods
You access a class by creating an INSTANCE of the class in your module code
DIM myclassitem as new myclass
The INFO and CONTROLLER classes that seem to be confusing you so much are two DNN specific classes that help you handle access to the Database in an elegant way.
For the purposes of this thread - both michael and others are talking about DNN DAL+ which uses 2 class objects - the more complicated DNN DAL uses a couple of additional class constructs to allow for data access abstraction - but lets leave that to the side for now.
The INFO class is a normal ASP.NET class that defines the structure of the object that represents a MSSQL table that you are trying to access
The CONTROL class is a normal ASP.NET class that defines the methods used to physically access the database and hydrate or populate the info class.
Assuming you have created the info class and controll class - you access them as you would any other asp.net class.
' firest CREATE new class object
DIM myController as new MyControllerClass
DIM myInfo as new MyInfoClass
' you can now use the methods in the controller class to work with the info class
'add data
myInfo.idkey = 1
myInfo.sometext = "hello"
myController.update( myInfo)
'get data
myInfo = myController.getkey(1 )
myvalue = myInfo.sometext
'update data
myInfo = myController.getkey( 1 )
myInfo.sometext = "hello again"
myController.update( myInfo)
'delete data
myInfo = myController.getkey( 1 )
myController.delete( myInfo)
>>>>>>>>>>>>>>>
As to how you create the DAL+ classes - there are a number of ways
- by hand
they are not really that hard to create
look at the code in an existing sample for starters
- using a codesmith DAL+ template
http://community.codesmithtools.com/forums/thread/21596.aspx
or do a search of the threads here for codesmith
- using other 3rd party DAL+ class generators.
check out www.snowcovered.com and other stores
>>>>>>>>>>>>>>>>
Westa