- The presenation can be downloaded here: http://rnqaxa.bay.livefilestore.com/y1pbWRFVfKReveKp_2yfJT8CBP-qnCnKtT88YFay__X13HGdFKW4P17fc1IveV4IZnDN6_zzWH--zvEpZrs0JgPaA/Introduction%20to%20ORM.pps?download
- Typical app.config for Data Access Layer: http://rnqaxa.bay.livefilestore.com/y1pgffvs89cMsjlBGovI2utC2u8QyzRk30n9cLrltdFXPjsfFTwFzJamXAVLZcLN75Y82gazw-PQrEwPMq5T7p7VA/app.config?download
- Typical Product class file for Business Layer: http://rnqaxa.bay.livefilestore.com/y1paEkdv6L0yBSokpSeZsH1h4eQLk-jlz1Ln3tuaSoUGaiu_N58csJIeFywlLgCNPTjD_CjCMsVjPdF2oacttuFQg/BusinessLayer.Product.vb?download
Steps for downloading and installing:
- Download
- Install
- Add External Tool command to Tools menu
- Title: SubSonic DAL
- Command: SubCommander/sonic.exe
- Arguments: generate /out Generated /lang VB
- Initial directory: ($ProjectDir) Use
- Output window Prompt for arguments
- Add Subsonic Toolbar Customise Add External Tool 1
Steps to Generating DAL classes:
- Open new Web Application Project (AdventureWorks)
- Open IIS Manager
- Enable Directory Security, Integrated Windows Authentication
- Add VB Class Library Project (AdventureWorks.DataAccess)
- Ensure Project Root Namespace = “AdventureWorks”
- Add Reference to Subsonic.dll, System.Configuration, System.Web
- Delete Class1.vb
- Edit app.config
- Add section reference to
- Add a connection string for each one of your providers
- Define Subsonic Service Provider(s) (one per database):
- Add Generated folder to DataAccess folder (or project)
- Execute Subsonic
- Add Existing Item(s)
- Build
Using in Web Project:
- Add a Business Logic Layer (Class Library)
- Add References to SubSonic.dll, AdventureWorks.DataAccess
- Rename Class1 as Product
- Define the class as Public, decorated with
- Define methods as Public, decorated with
- Save and Compile
- Add a Grid to a Web Page
- Add Reference to Subsonic.dll
- Add SubsonicSection to web.config
- Add SubsonicProvider to web.config
- Add ConnectionString to web.config. Highlight difference in user ID.
- Set Default.aspx as Start Page
- Build and Run (F5)
No comments:
Post a Comment