日期:2014-05-17  浏览次数:20973 次

求注释程序!
namespace SoccerVIP
{
    public partial class Form1 : Form
    {
        string tID = "";
        DataSet myDataSet;
        OleDbConnection myOleConn;
        OleDbDataAdapter myDataAdapter;

        public void RefreshDG()
        {
            if (myDataSet.Tables.Contains("SoccerClub"))
            {
                myDataSet.Tables.Remove("SoccerClub");
            }
            string sql = "select * from SoccerClub ";
            myDataAdapter = new OleDbDataAdapter(sql, myOleConn);
            myDataAdapter.Fill(myDataSet, "SoccerClub");
            dataGridViewSoccer.DataSource = myDataSet.Tables["SoccerClub"];


        }

        public Form1()
        {
            InitializeComponent();
        }
       

        private void Form1_Load(object sender, EventArgs e)
        {
            btnShow_Click_1(sender, e);
            btnModify.Enabled = false;
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            if((txtFirstname.Text=="")||(txtLastname.Text=="")||(txtTel.Text=="")||(txtAddress.Text=="")||(txtFavoriteTeam.Text=="")||(txtRentTime.Text=="")||(txtCoach .Text==""))
            {
                MessageBox.Show("不能为空");
                    return;

            }
            string sql = "insert into SoccerClub(firstName,lastName,tel,address,favoriteTeam,rentTime,coach) values('" + txtFirstname.Text + "','"
            +txtLastname.Text+"',"+txtTel.Text+",'"+txtAddress.Text+"','"+txtFavoriteTeam.Text+"','"+txtRentTime.Text +"',"+txtCoach.Text+")";