Dim s As New Sira
Dim intLineNo As Integer
Select Case ddlLname.Text
Case "Trim 1"
intLineNo = "1"
Case "Trim 2"
intLineNo = "2"
Case "IP"
intLineNo = "3"
Case "Door"
intLineNo = "4"
Case "Chassis 1"
intLineNo = "5"
Case "Chassis 2"
intLineNo = "6"
Case "Frame 1"
intLineNo = "7"
Case "Frame 2"
intLineNo = "8"
Case "Engine"
intLineNo = "9"
Case "Axle"
intLineNo = "10"
Case "Final 1"
intLineNo = "11"
Case "Final 2"
intLineNo = "12"
Case "Final 3"
intLineNo = "13"
Case "Inspection"
intLineNo = "14"
End Select
Dim strStime As String = ddlSmonth.Text & "/" & ddlSday.Text & "/" & ddlSyear.Text & " " & ddlTper0.Text & ":00"
Dim strEtime As String = ddlEmonth.Text & "/" & ddlEday.Text & "/" & ddlEyear.Text & " " & ddlTper1.Text & ":00"
Dim strSQL As String = "select case c.intLineNo when '1' then 'Trim 1' when '2' then 'Trim 2' when '3' then 'IP' when '4' then 'Door' when '5' then 'Chassis 1' when '6' then 'Chassis 2' when '7' then 'Frame 1' when '8' then 'Frame 2' when '9' then 'Engine' when '10' then 'Axle' when '11' then 'Final 1' when '12' then 'Final 2' when '13' then 'Final 3' when '14' then 'Inspection' end as intLineNo " & _
", c.intToolID as intQID , c.strToolName as strEquipName , c.intStationNo , c.strLineSide " & _
", case (d.intJudgementResult1 + d.intJudgementResult2 + d.intJudgementResult3 + d.intJudgementResult4 + d.intJudgementResult5) when '160' then 'OK' when '320' then 'NG' end as Pass " & _
"from (ToolConfig as c inner join PokayokeToolLog as h on c.intLineNo = h.intLineNumber) " & _
"inner join PokayokeQualityResultLog as d on h.intToolLogID = d.intToolLogID " & _
"where h.datInsertTimestamp >= '" & strStime & "' and h.datInsertTimestamp <= '" & strEtime & "' and c.intLineNo = '" & intLineNo.ToString & "' and c.bitEnabled = 'true'"
DV = s.GetDataTable(strSQL).DefaultView
gvShow.DataSource = DV
gvShow.DataBind()
Tag : .NET, Ms SQL Server 2005, Ms SQL Server 2008, VB.NET, VS 2010 (.NET 4.x)