• 个人作业


     个人Psp

    计划:需要一星期

    需求分析:作为一个观众需要知道每一场的比赛得分情况,分数详细,列出局分以便了解比赛的战况。

    生成设计文档:需要一个查询队伍界面,和比赛的具体得分.

     

    设计复审:自己.没有组员参加.

    代码规范:c#语言.Winfrom窗体.

    具体设计:1,选择观众界面.

     

    2,查询 场分,局分,胜负.

     

    具体代码:(还没完成全部编写)

      private void DataGridView( string sql="select * from biao")

            {

                SqlConnection conn = new SqlConnection("server=.;database=biao;uid=sa;pwd=123456");

                SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);

                DataSet ds = new DataSet();

     

                adapter.Fill(ds);

     

                dataGridView1.DataSource = ds.Tables[0];

            }

     

            private void ComboBox1()

            {

                comboBox1.Items.Clear();

                comboBox1.Items.Add("");

                comboBox1.SelectedIndex=0;

                SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=biao;Integrated Security=True");

                string str = "select distinct Name from biao";

               SqlCommand comm = new SqlCommand(str, conn);

                conn.Open();

                SqlDataReader reader = comm.ExecuteReader();

                if (reader.HasRows)

                {

                    while (reader.Read())

                    {

                        comboBox1.Items.Add(reader[0]);

                    }

                }

                reader.Close();

                conn.Close();

            }

     

            private void button1_Click(object sender, EventArgs e)

            {

                string Name = comboBox1.Text.Trim();

                StringBuilder sql = new StringBuilder("select * from biao where 1=1");

                if (!String.IsNullOrEmpty(Name))

                {

                    sql.Append("and Name like '%" + Name + "%'");

                }

     

                DataGridView(sql.ToString());

            }

     

            private void chaxunToolStripButton_Click(object sender, EventArgs e)

            {

                try

                {

                    this.biaoTableAdapter.chaxun(this.biaoDataSet.biao);

                }

                catch (System.Exception ex)

                {

                    System.Windows.Forms.MessageBox.Show(ex.Message);

                }

     

            }

     

            private void fillByToolStripButton_Click(object sender, EventArgs e)

            {

                try

                {

                    this.biaoTableAdapter.FillBy(this.biaoDataSet.biao);

                }

                catch (System.Exception ex)

                {

                    System.Windows.Forms.MessageBox.Show(ex.Message);

                }

     

            }

     

    测试:无.未完成.

    测试报告:无

    计算工作量:未统计

    事后总结:还未完成,等完成在做具体总结

  • 相关阅读:
    eclipse如何导入项目
    CBC和CTR解密模式——C++实现
    安装java之后没有jre目录
    对称密钥解密——C++方法
    使用Eclipse时一些报错
    C/C++文件I/O操作
    获取string的长度
    新建ftp快捷方式
    一些IT书籍
    C语言获得数组长度的函数
  • 原文地址:https://www.cnblogs.com/wuhao123/p/6218403.html
Copyright © 2020-2023  润新知