Take value from query to label in C#

前端 未结 8 1121
逝去的感伤
逝去的感伤 2021-01-26 12:48

How can i take value from query result to label?

I have two label, one is labelName and one more is labelDepartment

So when i r

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-26 13:20

    Populate the Dataset with your Query and then retrieve values from Dataset and assign it to your label.

    Lets say your Dataset is DS then:

    labelName.Text=DS.Tables[0]["tbl_staff.staffName"].tostring();
    labelDepartment.Text=DS.Tables[0]["tbl_department.department"].tostring();
    

    Hope this helps.

提交回复
热议问题