资源简介
数据库课程设计题目-机房管理系统(SQL Server 2008;C#实现)
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace JFMS
{
public partial class Form1 : Form
{
private SqlConnection Conn = new SqlConnection(“Server=COMMANDER-PC\\COMMANDSQLSERVER;Integrated security=SSPI;database=JFMS“);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
Conn.Open();
this.recordsTableAdapter1.Fill(this.jFMSDataSet.records);
this.timetableAdapter1.Fill(this.jFMSDataSet.time);
this.dateTableAdapter1.Fill(this.jFMSDataSet.date);
this.studentTableAdapter1.Fill(this.jFMSDataSet.student);
Refresh_status();
Refresh_student();
Refresh_time_rec();
Refresh_date_rec();
comboBox1.SelectedIndex = 0;
}
private void Form1_FormClosing(object sender FormClosingEventArgs e)
{
Conn.Close();
}
private void Refresh_status() //刷新机位状态
{
if (Conn.State == ConnectionState.Open)
{
SqlDataAdapter adapter = new SqlDataAdapter(“select num from status order by num ASC“ Conn);
DataSet dataset = new DataSet();
adapter.Fill(dataset);
int count = (int)dataset.Tables[0].Rows.Count;
comboBox2.Items.Clear();
for (int n = 0; n < count; n++)
{
comboBox2.Items.Add(dataset.Tables[0].Rows[n][“num“].ToString());
}
comboBox2.SelectedIndex = 0;
SqlDataAdapter newadapter = new SqlDataAdapter(“select num from status where status=‘N‘ order by num ASC“ Conn);
DataSet newdataset = new DataSet();
newadapter.Fill(newdataset);
int newcount = (int)newdataset.Tables[0].Rows.Count;
comboBox3.Items.Clear();
for (int n = 0; n < newcount; n++)
{
comboBox3.Items.Add(newdataset.Tables[0].Rows[n][“num“].ToString());
}
comboBox3.SelectedIndex = 0;
SqlDataAdapter newnewadapter = new SqlDataAdapter(“select num from status where status=‘Y‘ order by num ASC“ Conn);
DataSet newnewdataset = new DataSet();
newnewadapter.Fill(newnewdataset);
int newnewcount = (int)newnewdataset.Tables[0].Rows.Count;
comboBox4.Items.Clear();
for (int n = 0; n < newnewcount; n++)
{
comboBox4.Items.Add(newnewdataset.Tables[0].Rows[n][“num“].ToString());
}
if (comboBox4.Items.Count ==
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3145728 2011-06-21 18:45 Databa
文件 1048576 2011-06-21 18:45 Databa
文件 400 2011-06-06 20:22 JFMS\app.config
文件 116224 2011-06-13 18:44 JFMS\bin\Debug\JFMS.exe
文件 400 2011-06-06 20:22 JFMS\bin\Debug\JFMS.exe.config
文件 226816 2011-06-13 18:44 JFMS\bin\Debug\JFMS.pdb
文件 14328 2011-06-20 17:50 JFMS\bin\Debug\JFMS.vshost.exe
文件 400 2011-06-06 20:22 JFMS\bin\Debug\JFMS.vshost.exe.config
文件 490 2009-06-11 05:14 JFMS\bin\Debug\JFMS.vshost.exe.manifest
文件 33869 2011-06-13 18:44 JFMS\Form1.cs
文件 100106 2011-06-13 18:33 JFMS\Form1.Designer.cs
文件 8892 2011-06-13 18:33 JFMS\Form1.resx
文件 3969 2011-06-13 18:20 JFMS\JFMS.csproj
文件 897 2011-06-04 21:41 JFMS\JFMS.sln
..A..H. 16384 2011-06-20 17:52 JFMS\JFMS.suo
文件 205959 2011-06-13 18:20 JFMS\JFMSDataSet.Designer.cs
文件 3 2011-06-13 18:20 JFMS\JFMSDataSet.xsc
文件 28113 2011-06-13 18:20 JFMS\JFMSDataSet.xsd
文件 3 2011-06-13 18:20 JFMS\JFMSDataSet.xss
文件 913 2011-06-20 17:50 JFMS\obj\Debug\JFMS.csproj.FileListAbsolute.txt
文件 847 2011-06-13 18:33 JFMS\obj\Debug\JFMS.csproj.GenerateResource.Cache
文件 116224 2011-06-13 18:44 JFMS\obj\Debug\JFMS.exe
文件 180 2011-06-13 18:33 JFMS\obj\Debug\JFMS.Form1.resources
文件 226816 2011-06-13 18:44 JFMS\obj\Debug\JFMS.pdb
文件 180 2011-06-13 18:20 JFMS\obj\Debug\JFMS.Properties.Resources.resources
文件 77824 2011-06-13 18:20 JFMS\obj\Debug\TempPE\JFMSDataSet.Designer.cs.dll
文件 36864 2011-06-13 18:08 JFMS\obj\Debug\TempPE\JFMSDataSet1.Designer.cs.dll
文件 36864 2011-06-13 18:08 JFMS\obj\Debug\TempPE\JFMSDataSet2.Designer.cs.dll
文件 465 2011-06-04 21:41 JFMS\Program.cs
文件 1358 2011-06-04 21:41 JFMS\Properties\AssemblyInfo.cs
............此处省略18个文件信息
- 上一篇:机器人路径规划c#
- 下一篇:C#中的TCP和UDP通信的实现
评论
共有 条评论