[翻译]ADO.NET Entity Framework Beta2(七)/快速入门(实体框架)(2)/创建ClassSchedule窗体应用程序

简介:

In this task, you will create the Class Schedule Windows application by using Visual Studio 2008.

在这一任务中,你将使用Visual Studio 2008 创建ClassSchedule窗体应用程序

To create the Class Schedule application by using Visual Studio

使用Visual Studio创建ClassSchedule应用程序

  1. On the File menu, point to New, and click Project.
    文件菜单点击新建项目。(我用的VS2008Bata2 Team Suite中文版和帮助上的步骤略有不同)

  2. Choose either Visual Basic or Visual C# in the Project Types pane.
    项目类型面板中选择Visual BasicVisual C#。

  3. Select Windows Forms Application in the Templates pane.
    模板面板中选择Windows窗体应用程序。

  4. Enter ClassSchedule for the project name, and then click OK.
    给项目起名为ClassSchedule,然后单击确定。(右上角的.NET框架版本选择器应该选3.5哦)

To create the Class Schedule form/创建ClassSchedule窗体

  1. In the ClassSchedule project, select the default form (Form1), change the Name property to StudentSchedule, and change the Text property to Student Schedule.
    在ClassSchedule项目中选择默认窗体(Form1),修改窗体的Name属性为StudentSchedule,再修改Text属性为Student Schedule

  2. In the Solution Explorer, double-click the StudentSchedule form.
    在解决方案资源管理器中,双击StudentSchedule窗体。

    This opens the form designer.
    该操作打开窗体设计器(晕,默认就已经打开了啊)

  3. In the Toolbox, expand Common Controls, drag the ComboBox control to the form, and change the name of the control to studentsList. 在左侧的工具箱里,展开公共控件面板,向窗体上拖放一个组合框控件,将该控件的Name属性修改成studentsList

  4. In the Toolbox, drag the Button control to the form, change the name of the control to closeForm, and change the Text value to Close.
    再次从工具箱向窗体拖放一个按钮控件,更改按钮控件的Name属性为closeForm,Text属性修改为Close

  5. In the Toolbox, expand Data, drag the DataGridView control to the form, and change the name of the control to studentClasses.
    展开左侧工具箱的数据面板,拖放一个数据表查看器控件到窗体上。更改他的Name属性为stucentClasses.

  6. Double-click the closeForm button control.
    鼠标双击窗体上的closeForm按钮。

    This opens the code page for the form and creates the closeForm_Click event handler method.
    本步骤将打开当前窗体的代码视图并自动为closeForm按钮创建closeForm_Click事件处理方法

  7. In the closeForm_Click event handler method, type the following code that closes the form:
    在closeForm_Click事件处理方法的方法体内按实际项目语言输入下列代码以关闭窗口。

    Visual Basic
    ' Close the form.
    Me.Close()
    C#
    // Close the form.
    this.Close();

Next Steps/下一步

You have successfully created the class scheduling application. Next you will generate the mapping files that describe an Entity Data Model (EDM) based on a 1:1 mapping against the School database that you created in the first task:

您已经成功创建了ClassSchedule应用程序.下一步你将开始使用在第一个任务中创建的学校数据库来生成一个与数据库一一对应的实体数据模型映射文件.

Generating the School Entity Data Model/生成学校实体数据模型

See Also/请参考

Concepts/概念

Quickstart (Entity Framework)/快速入门(实体框架)

Other Resources/其它资源

Feature Reference (Entity Framework)/功能参考(实体框架)

 

作者: 徐少侠
出处: http://www.cnblogs.com/Chinese-xu/

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
如有问题,可以通过 Chinese_Xu@126.com 联系我,非常感谢。

分享家:Addthis中文版

本文转自徐少侠博客园博客,原文链接:http://www.cnblogs.com/Chinese-xu/archive/2007/09/21/901399.html,如需转载请自行联系原作者
目录
相关文章
|
10月前
|
JSON 数据格式
【Azure Fabric Service】演示使用PowerShell命令部署SF应用程序(.NET)
本文详细介绍了在中国区微软云Azure上使用Service Fabrics服务时,通过PowerShell命令发布.NET应用的全过程。由于Visual Studio 2022无法直接发布应用,需借助PowerShell脚本完成部署。文章分三步讲解:首先在Visual Studio 2022中打包应用部署包,其次连接SF集群并上传部署包,最后注册应用类型、创建实例并启动服务。过程中涉及关键参数如服务器证书指纹和服务端证书指纹的获取,并附带图文说明,便于操作。参考官方文档,帮助用户成功部署并运行服务。
339 73
|
C# Android开发 iOS开发
2025年全面的.NET跨平台应用框架推荐
2025年全面的.NET跨平台应用框架推荐
581 23
|
消息中间件 开发框架 监控
NET任务调度框架Hangfire使用指南
Hangfire 是一个用于 .NET 应用程序的开源任务调度框架,支持长时间运行任务、定时任务等。通过简单的安装配置,即可将任务从主线程分离,提升应用性能。支持多种数据库,提供丰富的任务类型如立即执行、延迟执行和周期性任务,并有可视化管理界面 Hangfire Dashboard。还支持安全性配置及扩展插件,如 Hangfire.HttpJob,适合各种复杂场景下的任务调度需求。
1325 1
NET任务调度框架Hangfire使用指南
|
监控 前端开发 API
一款基于 .NET MVC 框架开发、功能全面的MES系统
一款基于 .NET MVC 框架开发、功能全面的MES系统
429 5
|
开发框架 前端开发 .NET
ASP.NET CORE 3.1 MVC“指定的网络名不再可用\企图在不存在的网络连接上进行操作”的问题解决过程
ASP.NET CORE 3.1 MVC“指定的网络名不再可用\企图在不存在的网络连接上进行操作”的问题解决过程
473 0
|
开发框架 前端开发 JavaScript
ASP.NET MVC 教程
ASP.NET 是一个使用 HTML、CSS、JavaScript 和服务器脚本创建网页和网站的开发框架。
255 7
|
存储 开发框架 前端开发
ASP.NET MVC 迅速集成 SignalR
ASP.NET MVC 迅速集成 SignalR
293 0
|
开发框架 前端开发 .NET
ASP.NET MVC WebApi 接口返回 JOSN 日期格式化 date format
ASP.NET MVC WebApi 接口返回 JOSN 日期格式化 date format
235 0
|
开发框架 前端开发 安全
ASP.NET MVC 如何使用 Form Authentication?
ASP.NET MVC 如何使用 Form Authentication?
411 0
|
开发框架 .NET
Asp.Net Core 使用X.PagedList.Mvc.Core分页 & 搜索
Asp.Net Core 使用X.PagedList.Mvc.Core分页 & 搜索
497 0