日期:2014-05-16 浏览次数:20538 次
string strCon ="Data Source=(local);DataBase=kaoshi;User id=sa;pwd=123";
string SqlCom="select StudentID,sum(GF)as Zchengji from HD_TK group by StudentID";
SqlConnection sqlCon = new SqlConnection(strCon);
sqlCon.Open();
SqlCommand sqlcom = new SqlCommand(SqlCom, sqlCon);
SqlDataReader read = sqlcom.ExecuteReader();
read.Read();
Label1.Text=read[1].ToString();