⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shanchu.cs

📁 火车票的销售系统
💻 CS
字号:
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 pwxt
{
    public partial class shanchu : Form
    {
       
        public shanchu()
        {
            InitializeComponent();
        }
   
        private void button1_Click(object sender, EventArgs e)
        {
            string str1 = "Delete  From LCtable Where 车次='" + this.textBox1.Text + "'";
            string str2 = "Delete  From lxtable Where 车次='" + this.textBox1.Text + "'";
            SqlConnection conn = new SqlConnection("server=127.0.0.1;uid=;pwd=;database=USer");
            SqlCommand cmd = new SqlCommand(str1, conn);
            SqlCommand scmd = new SqlCommand(str2, conn);
            conn.Open();
            int EXENum1= cmd.ExecuteNonQuery();
            if(EXENum1==1)
                 MessageBox.Show("删除LCtable信息成功", "删除提示页面", MessageBoxButtons.OK);
            int EXENum2 = scmd.ExecuteNonQuery();
            if(EXENum2==1)
                 MessageBox.Show("删除LCtable信息成功", "删除提示页面", MessageBoxButtons.OK);
            conn.Close();
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["connectionstring"]);
            SqlCommand cmd = new SqlCommand("Select * From lxtable Where 车次='" + this.textBox1.Text + "'", conn);
            SqlDataReader odr = null;
            conn.Open();
            odr = cmd.ExecuteReader();
            if (odr != null)
            {
                while (odr.Read())
                {
                    label4.Text = odr["时间"].ToString();
                    label6.Text = odr["路线"].ToString();
                }
            }
            odr.Close();
            conn.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -