1
projPoints1이라는 레이블을 SQL 쿼리가 반환하는 epual로 설정하고 싶습니다. 당신이 경우SQL 쿼리 결과에 따라 레이블 텍스트 변경
while(reader.Read())
{
projPoints1.Text = reader["proj"].ToString();
}
:
using (QC.SqlCommand cmd = new QC.SqlCommand("SELECT *,[proj] FROM[dbo].[WeeklyStats] WHERE[playerID] = @player1 AND [weeks] = @week1 "))
{
string week1 = Weeks.SelectedValue.ToString();
cmd.Parameters.AddWithValue("@player1", playerArr[0].ToString());
cmd.Parameters.AddWithValue("@week1", week1);
//runs the sql statement and adds them all to the dropdown list
cmd.Connection = connection;
cmd.CommandType = DT.CommandType.Text;
QC.SqlDataReader reader = cmd.ExecuteReader();
projPoints1.Text = ;
connection.Close();
}