code VB
Private Sub showdata()
Dim sql As New SqlDataSource()
Page.Controls.Add(sql)
Dim sqla As String = "SELECT Core_Competency.core, Expect_Position.expect, Score_core.score FROM Evaluator INNER JOIN Score_core ON Score_core.id_evaluator = Evaluator.id_evaluator INNER JOIN Evaluatee ON Evaluatee.id_evaluatee = Evaluator.id_evaluatee INNER JOIN Core_Competency ON Core_Competency.id_core = Score_core.id_core INNER JOIN Expect_Position ON Expect_Position.id_core = Score_core.id_core INNER JOIN Head_Position ON Head_Position.id_head = Expect_Position.id_head WHERE Evaluatee.id_personnel = '" & txtidper.Text & "' AND Expect_Position.id_head ='" & txthead.Text & "'"
With sql
.ID = "sqlDataSource2"
.ConnectionString = WebConfigurationManager.ConnectionStrings("EvaluationConnectionString").ConnectionString
.SelectCommand = sqla
.SelectCommandType = SqlDataSourceCommandType.Text
End With
GridView1.DataSource = sql
GridView1.DataBind()
With GridView1
.Columns(0).HeaderText = "รหัสสมาชิก"
.Columns(1).HeaderText = "ชื่อ สกุล"
.Columns(2).HeaderText = "ที่อยู่"
End With
End Sub
With GridView1
.Columns(0).HeaderText = "รหัสสมาชิก"
.Columns(1).HeaderText = "ชื่อ สกุล"
.Columns(2).HeaderText = "ที่อยู่"
End With
code VB
Private Sub showdata()
Dim sql As New SqlDataSource()
Page.Controls.Add(sql)
Dim sqla As String = "SELECT Core_Competency.core as x1, Expect_Position.expect as x2, Score_core.score asx3 FROM Evaluator INNER JOIN Score_core ON Score_core.id_evaluator = Evaluator.id_evaluator INNER JOIN Evaluatee ON Evaluatee.id_evaluatee = Evaluator.id_evaluatee INNER JOIN Core_Competency ON Core_Competency.id_core = Score_core.id_core INNER JOIN Expect_Position ON Expect_Position.id_core = Score_core.id_core INNER JOIN Head_Position ON Head_Position.id_head = Expect_Position.id_head WHERE Evaluatee.id_personnel = '" & txtidper.Text & "' AND Expect_Position.id_head ='" & txthead.Text & "'"
With sql
.ID = "sqlDataSource2"
.ConnectionString = WebConfigurationManager.ConnectionStrings("EvaluationConnectionString").ConnectionString
.SelectCommand = sqla
.SelectCommandType = SqlDataSourceCommandType.Text
End With
GridView1.DataSource = sql
GridView1.DataBind()
With GridView1
.Columns(0).HeaderText = "รหัสสมาชิก"
.Columns(1).HeaderText = "ชื่อ สกุล"
.Columns(2).HeaderText = "ที่อยู่"
End With
End Sub