我的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);
}
}
测试:无.未完成.
测试报告:无
计算工做量:未统计
过后总结:还未完成,等完成在作具体总结