Danh mục

Beginning SQL Server Modeling- P8

Số trang: 20      Loại file: pdf      Dung lượng: 1.54 MB      Lượt xem: 11      Lượt tải: 0    
10.10.2023

Hỗ trợ phí lưu trữ khi tải xuống: 8,000 VND Tải xuống file đầy đủ (20 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Tham khảo tài liệu beginning sql server modeling- p8, công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
Beginning SQL Server Modeling- P8CH APTER 6  SQL SERVER MODELING SERVICES – THE FOLDER PATTERN How do you modify this code to add a folder value? Folders are provided by the Repository.Itemmodel, so you’ll add an import directive for Repository.Item. Next you’ll add a Folder value to theCarComponent type definition, ascribed to the FoldersTable type: This is shown in Figure 6-2.Figure 6-2. Adding the Folder value, showing two reference errors But there’s a hitch: The M compiler is unable to resolve the Repository.Item model andFoldersTable type references. You need to specifically add a reference to the Repository.Item model,which, as it turns out, is contained in the Repository.dll file. Adding a reference to the Repository.dll filemust be done in the context of a Visual Studio project, and Intellipad provides a way of doing this: 1. Expand the Intellipad window horizontally to make room for a split window by dragging the right edge of the window to the right (see Figure 6-3). 2. Click on the View tab of the Intellipad window. 3. Select the Split Vertically option. This will split the Intellipad window vertically into two M mode panes, each with the same M code as appeared before the split. Download from Wow! eBook 141 Download from Wow! eBook CHAPTER 6  SQL SERVER MODELING SERVICES – THE FOLDER PATTERN Figure 6-3. Splitting the Intellipad window vertically to allow room for opening a new project Now you can add the new project: 1. Click the File tab of the Intellipad window. 2. Select the New Project option (as shown in Figure 6-4). 3. A Save Project As dialog box will pop up to allow you to name the new project file to be saved. Enter a project filename of CarModelWithFolder (see Figure 6-5). This will display a new project template in the right pane (see Figure 6-6). Figure 6-4. Adding a new project. (Right pane has focus.)142 Download from Wow! eBook CH APTER 6  SQL SERVER MODELING SERVICES – THE FOLDER PATTERNFigure 6-5. Saving the new project file as CarModelWithFolder.csprojFigure 6-6. New project (right pane) The new project file is based on a generic template, and includes a single generic M file (Model.munder the MCompile section) and a number of models under the Reference section. These are all modelsprovided in the SSMod Services Base Domain Library (BDL). I’ll say more about the BDL in the nextchapter. Note that the Reference section doesn’t include a reference to Repository, and theCarModelWithFolder.m file is not included in the MCompile section. So the project is initialized as ageneric project from a template, and has nothing to do with the model you are working with. Model.m isa placeholder code file, which could be used to flesh out the code you actually want for the domain 143 Download from Wow! eBook CHAPTER 6  SQL SERVER MODELING SERVICES – THE FOLDER PATTERN model definition file. Figure 6-7 shows the generic Model.m code after being created as a result of setting up the new project. Figure 6-7. Generic Model.m file created with the new project file Note that the module is named the same as the M code file that was loaded in Intellipad at the time you created the project, but it doesn’t reflect the code in that file. If you had started by creating the project file first, then using the Model.m file as the starting point for building the model code, this would have worked just as well. Intellipad, however, currently provides no facility for renaming the M file within the project file. If you’ve been following along with this example by executing the steps in Intellipad, you may have noticed that the configuration text in the project file is read-only and can’t be modified in this view. You can, however, add the CarModelWithFolder.m file to the project file by clicking the Project menu and selecting the Add Project File option, as shown in Figure 6-8. Figure 6-8. Setting up to add the CarModelWithFolder.m file to the MCompile section of the project file This will bring up an Open file dialog box, as shown in Figure 6-9. Select CarModelWithFolder.m and click the Open butto ...

Tài liệu được xem nhiều: