使用代码和设计器的基本思路一致。
1.简单的引用Appointment的Storeage mappings
AppointmentMappingCollection Mappings =new scheduleClinic.DataStorage.AppointmentStorage.Mappings();
2.设置field mappings和数据源映射
- Mappings.IdMapping.MappingName = "iA99"
- Mappings.Body.MappingName = "Body"
- Mappings.End.MappingName = "EndTime"
- Mappings.Location.MappingName = "Location"
- Mappings.Start.MappingName = "StartTime"
- Mappings.Subject.MappingName = "Subject"
- Mappings.AppointmentProperties.MappingName = "Properties"
复制代码
3.设置DataSource
- scheduleClinic.DataStorage.AppointmentStorage.DataSource = DSClinicSchedule.Tables["Appointment"]
复制代码
|