我想在tender_partial表中按照tenId显示文本if(j == str)然后招标栏的状态显示“暂停”否则不等待。在标签中,其id为模板字段中gridview中的lblstat。
for (int i = 0; i < count; i++) {
if (ds.Tables[0].Rows.Count > 0) {
string j=ds.Tables[0].Rows[0][0].ToString();
SqlCommand cmd1 = new SqlCommand("Select TenderId from Tender_Partial where TenderId=" + j,con);
SqlDataReader dr = cmd1.ExecuteReader();
while(dr.Read()) {
string id2 = dr["TenderId"].ToString();
if (j == id2) // here where i get value j equals to id2 then
{
status="On Hold";
status=Gridview1.row[8].cell[8].Findcontrol("lblstats").tostring();
}
else {
status=" Not On Hold";
status=Gridview1.row[8].cell[8].Findcontrol("lblstats").tostring();