• 大小: 537KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: 其他
  • 标签: C#  Winform  

资源简介

该项目完成了航空公司航班查询预订的的基本功能,预订查询

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace MyTicketSystem
{
    public class DBHelper
    {
        //连接字符串
        private string connstring = “Data Source=.;Initial Catalog=MyTicket;User ID=sa;Pwd=123456“;
      //数据库连接对象
        private SqlConnection connction;
        public SqlConnection Connction
        {
            get {
                if (connction==null)
                {
                    connction = new SqlConnection(connstring);
                }
                return connction;
            }
        }
        //打开数据库
        public void OpenConnection()
        {
            if (connction.State==ConnectionState.Closed)
            {
                Connction.Open();
            }
            else if(connction.State==ConnectionState.Broken)
            {
                Connction.Close();
                Connction.Open();
            }
        }
        //关闭数据库
        public void CloseConnection()
        {
            if (connction.State==ConnectionState.Open||(connction.State==ConnectionState.Broken))
            {
                Connction.Close();
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        3940  2017-12-25 15:05  航班查询预订系统\hangban.sql
     文件     4259840  2017-12-25 15:08  航班查询预订系统\MyTicket_data.mdf
     文件     1048576  2017-12-25 15:08  航班查询预订系统\MyTicket_log.ldf
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\
     文件         932  2017-12-20 15:20  航班查询预订系统\MyTicketSystem\MyTicketSystem.sln
     文件       42496  2017-12-25 15:06  航班查询预订系统\MyTicketSystem\MyTicketSystem.v11.suo
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\MyTicketSystem\
     文件         187  2017-12-20 15:20  航班查询预订系统\MyTicketSystem\MyTicketSystem\App.config
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\
     文件       19456  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.exe
     文件         187  2017-12-20 15:20  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.exe.config
     文件       32256  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.pdb
     文件       22984  2017-12-25 15:06  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.vshost.exe
     文件         187  2017-12-20 15:20  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.vshost.exe.config
     文件         490  2016-07-16 19:44  航班查询预订系统\MyTicketSystem\MyTicketSystem\bin\Debug\MyTicketSystem.vshost.exe.manifest
     文件        1347  2017-12-21 09:42  航班查询预订系统\MyTicketSystem\MyTicketSystem\DBHelper.cs
     文件        6552  2017-12-25 15:04  航班查询预订系统\MyTicketSystem\MyTicketSystem\Form1.cs
     文件       20654  2017-12-25 14:32  航班查询预订系统\MyTicketSystem\MyTicketSystem\Form1.Designer.cs
     文件        7663  2017-12-25 14:32  航班查询预订系统\MyTicketSystem\MyTicketSystem\Form1.resx
     文件        3846  2017-12-20 17:42  航班查询预订系统\MyTicketSystem\MyTicketSystem\MyTicketSystem.csproj
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\
     目录           0  2017-12-25 15:07  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\
     文件        1308  2017-12-21 09:16  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7047  2017-12-20 16:52  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         800  2017-12-25 15:06  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.csproj.FileListAbsolute.txt
     文件         975  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.csproj.GenerateResource.Cache
     文件       19456  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.exe
     文件         180  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.Form1.resources
     文件       32256  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.pdb
     文件         180  2017-12-25 15:03  航班查询预订系统\MyTicketSystem\MyTicketSystem\obj\Debug\MyTicketSystem.Properties.Resources.resources
............此处省略11个文件信息

评论

共有 条评论