我的做業

 我的Pspsql

計劃:須要一星期c#

需求分析:做爲一個觀衆須要知道每一場的比賽得分狀況,分數詳細,列出局分以便了解比賽的戰況。測試

生成設計文檔:須要一個查詢隊伍界面,和比賽的具體得分.ui

 

 

設計複審:本身.沒有組員參加.this

代碼規範:c#語言.Winfrom窗體.設計

具體設計:1,選擇觀衆界面.代碼規範

 

 

2,查詢 場分,局分,勝負.orm

 

 

具體代碼:(還沒完成所有編寫)server

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

        {

            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);

            }

 

        }

 

測試:無.未完成.

測試報告:無

計算工做量:未統計

過後總結:還未完成,等完成在作具體總結

相關文章
相關標籤/搜索