|
Partial Class EmpDetails
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Private Sub BindData()
Dim pk As Integer
pk = CInt(Session("EMPID"))
Dim xmlDS = XElement.Load(Request.PhysicalApplicationPath & "/App_Data/Employee.xml")
Dim query = From row In xmlDS.Elements Where (CType(row.Attribute("empno"), Integer) = pk) Select row
For Each row As XElement In query
lblEmpNo.Text = row.Attribute("empno")
lblEmpName.Text = row.Attribute("ename")
lblJob.Text = row.Attribute("job")
lblHireDt.Text = row.Attribute("hiredate")
lblSal.Text = row.Attribute("sal")
lblDeptNo.Text = row.Attribute("deptno")
lblDeptName.Text = row.Attribute("dname")
lblLoc.Text = row.Attribute("loc")
Next
End Sub
Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBack.Click
Response.Redirect("Employee.aspx")
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.