Home >> Daolite >> Getting Started with Daolite

Step 1: Create Business object classes and corresponding mapping file – It's recommended that you use DaoliteMappingTool to create all of your Business object classes and corresponding mapping files. It's easy and fast. The following is step-by-step guide on how to create Business object classes and corresponding mapping files using DaoliteMappingTool.



Step 2: Add the Business object classes and mapping files created in Step 1 to your project.

Step 3:Add the mapping files(in a mappings folder) created by Daolitemappingtool as resources to your project.
Step 5: Add Daolite.dll as Reference to your project.

Step 5: Set datasoure value to Configer of Business layer in the main Function of Program.cs, and load mapping files to the project.
For instance:
static void Main()
{
//Datasource value
NorthwindConfiger.DataSource = "192.168.1.2";
NorthwindConfiger.Database = "Northwind";
NorthwindConfiger.UserId = "sa";
NorthwindConfiger.Password = "******";
//loading mapping files
NorthwindConfiger.GetConfiger().AddResourseMappings("Northwind");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
Done. Now you can experience the superiority of Daolite during programming.
Step 1:Follow the operations in Windows Application Step 1.
Step 2:Create a new ClassLibrary project for your solution, and then add the business object classes (excluding mapping files) to the project.

Step 3: Add mapping files(in a mappings folder) created by Daolitemappingtool to the App_data folder of your website project.

Step 4: Add Daolite.dll as Reference to both your website project and the ClassLibrary project you newly created.
Step 5: Add your newly created ClassLibrary project as reference to your website Bin folder.

Step 6: Set datasoure value to Configer of business objects in the Application_Start Function of Global.asax within your website project, and load mapping files to the project.
For instance:
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Northwind.NorthwindConfiger.DataSource = "192.168.1.2";
Northwind.NorthwindConfiger.Database = "Northwind";
Northwind.NorthwindConfiger.UserId = "sa";
Northwind.NorthwindConfiger.Password = "******";
Northwind.NorthwindConfiger.GetConfiger()
.AddMappings("Northwind", Server.MapPath("~/app_data/Northwind_mappings/"));
}
Done.Now you can experience the superiority of Daolite in the course of building your website.

Copyright© 2008 iDevLite,Inc. All Rights Reserved.