form1.cs

来自「实现飞机定票.用c#语言编写」· CS 代码 · 共 46 行

CS
46
字号
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;


namespace AirlineBooking4439
{
    public partial class Form1 : Form
    {

        private localhost.FlightBooking4439 service;
        private DataSet ds;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds1 = service.update(ds);
                ds = ds1;
                dataGrid1.DataSource = ds;
                dataGrid1.DataMember = ds.Tables[0].TableName;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            service = new localhost.FlightBooking4439();
            ds = service.getInfo();
            dataGrid1.DataSource = ds;

        }
    }
}

⌨️ 快捷键说明

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