资源简介
Visual C# and Databases is a tutorial that provides a detailed introduction to using Visual C# for accessing and maintaining databases. Topics covered include: database structure, database design, Visual C# project building, ADO .NET data objects, data bound controls, proper interface design, structured query language (SQL), and database reports.
Visual C# and Databases is presented using a combination of over 700 pages of course notes and actual Visual C# examples. No previous experience working with databases is presumed. It is assumed, however, that users of the course are familiar with the Visual C# environment and the steps involved in building a Visual C# application.
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Example_1_1
{
public partial class frmMailingList : Form
{
public frmMailingList()
{
InitializeComponent();
}
DateTime lastNow;
TimeSpan elapsedTime;
private void btnStart_Click(object sender EventArgs e)
{
// Start button clicked
// Disable start and exit buttons
// Enabled pause button
btnStart.Enabled = false;
btnExit.Enabled = false;
btnPause.Enabled = true;
// Establish start time and start timer control
lastNow = DateTime.Now;
timSeconds.Enabled = true;
// Enable mailing list frame
grpMail.Enabled = true;
txtName.Focus();
}
private void btnPause_Click(object sender EventArgs e)
{
// Pause button clicked
// Disable pause button
// Enabled start and exit buttons
btnPause.Enabled = false;
btnStart.Enabled = true;
btnExit.Enabled = true;
// Stop timer
timSeconds.Enabled = false;
// Disable editing frame
grpMail.Enabled = false;
}
private void btnExit_Click(object sender EventArgs e)
{
this.Close();
}
private void timSeconds_Tick(object sender EventArgs e)
{
// Compute elapsed time and display
elapsedTime += DateTime.Now - lastNow;
txtElapsedTime.Text = Convert.ToString(new TimeSpan(elapsedTime.Hours elapsedTime.Minutes elapsedTime.Seconds));
lastNow = DateTime.Now;
}
private void txtInput_KeyPress(object sender KeyPressEventArgs e)
{
String boxName = ((TextBox) sender).Name;
// Check for return key
if ((int) e.KeyChar == 13)
{
switch (boxName)
{
case “txtName“:
txtAddress.Focus();
break;
case “txtAddress“:
txtCity.Focus();
break;
case “txtCity“:
txtState.Focus();
break;
case “txtState“:
txtZip.Focus();
break;
case “txtZip“:
btnAccept.Focus();
break;
}
}
// In zip text box make sure only numbers or backspace pressed
if (boxName.Equals(“txtZip“))
{
if ((e.KeyChar >= ‘0‘ && e.KeyChar <= ‘9‘) || (int) e.KeyChar == 8)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
}
private void btnAccept_Click(object sender EventArgs e)
{
string s;
// Accept button clicked - form label and output in message box
// Make sure each text box has entry
if (txtName.Text.Equals(““) || txtAddress.Text.Equals(““) || txtCity.Text.Equals(““) || txtState.Text.Equals(““) || txtZip.Text.Equals
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-06-12 03:23 VCS200XDB\Code\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 1\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 1\Example 1-1\
文件 3660 2006-12-28 23:12 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.cs
文件 3296 2006-12-28 23:11 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.csproj
文件 11402 2006-12-28 23:12 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.Designer.cs
文件 6186 2006-12-28 09:16 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.resx
文件 910 2006-12-28 04:47 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.sln
文件 12288 2008-03-03 20:54 VCS200XDB\Code\Class 1\Example 1-1\Example 1-1.suo
文件 435 2006-12-28 23:12 VCS200XDB\Code\Class 1\Example 1-1\Program.cs
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 1\Example 1-1\Properties\
文件 1270 2006-12-28 23:11 VCS200XDB\Code\Class 1\Example 1-1\Properties\AssemblyInfo.cs
文件 2847 2006-12-28 23:11 VCS200XDB\Code\Class 1\Example 1-1\Properties\Resources.Designer.cs
文件 5612 2006-12-28 04:15 VCS200XDB\Code\Class 1\Example 1-1\Properties\Resources.resx
文件 1090 2006-12-28 23:11 VCS200XDB\Code\Class 1\Example 1-1\Properties\Settings.Designer.cs
文件 249 2006-12-28 04:15 VCS200XDB\Code\Class 1\Example 1-1\Properties\Settings.settings
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\
目录 0 2008-06-13 20:19 VCS200XDB\Code\Class 10\Example 10-1\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Example 10-1\Properties\
目录 0 2008-06-13 20:20 VCS200XDB\Code\Class 10\Example 10-2\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Example 10-2\Inventory Photos\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Example 10-2\Properties\
目录 0 2008-06-13 19:57 VCS200XDB\Code\Class 10\Example 10-3\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Example 10-3\HelpFile\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Example 10-3\Properties\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Setup 10-3\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Setup 10-3\Debug\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 10\Setup 10-3\Release\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 11\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 11\Example 11-1\
目录 0 2008-06-12 03:22 VCS200XDB\Code\Class 11\Example 11-1\Properties\
............此处省略400个文件信息
- 上一篇:C# 图像处理
- 下一篇:asp.net校园二手交易中心
相关资源
- C# 图像处理
- 仓库管理系统_代码_数据库_完整版_
- C#表情识别源码
- 个人通讯录管理系统C#+Sql Sever
- 餐饮管理系统 C#
- 用C#写的汽车销售管理系统
- C#网上书店
- c#写的pdf转word程序源码
-
C#+xm
l生成word报告 - C#窗体关于汽车的简单管理增删改带数
- 模拟ATM取款机源码(C#版)完整版
- C#学生宿舍管理系统SQL版.
- VS实现简单通讯录
- 基于C#的人事管理系统
- 商品销售管理系统C#源码
- 吃豆豆c#游戏程序源码
- C# SQL Server 人事工资管理系统
- 原型设计器 C#版
- C#经典范例50讲源代码打包
- 网上图书在线书店销售系统(毕业设
- C#财务管理系统完整源码
- ASP.net 网上商城完整源码(C#)
- C#商品销售管理系统完整源码(进销存
- 小区物业管理系统c#源码
- C#与各种PLC通讯测试
- ASP.NET网上商城完整源码201903
- C# webkit为内核的浏览器打开网页源码
- C#考勤管理系统完整源码2019
- C#winform 实现PDF阅读功能2019
- C#原生报表操作--设置每页打印30行2
评论
共有 条评论