ที่คิดไว้เป็นการใช้ for แต่เราไม่ค่อยเข้าใจการใช้ for ไม่รู้จะเขียนโค้ดอย่างไร
Code (VBScript)
sqlselect = "SELECT weight FROM Evaluator WHERE id_evaluator = 'O000000001'"
cmd = New SqlCommand()
dsChk.Clear()
daChk = New SqlDataAdapter(sqlselect, conn)
daChk.Fill(dsChk, " Evaluator")
With cmd
.CommandType = CommandType.Text
.CommandText = sqlselect
.Connection = conn
dr = .ExecuteReader()
End With
dr.Read()
If dr.HasRows Then
count_evaluator = CDbl(dr(0)) 'มีค่าเท่ากับ 10
End If
dr.Close()
sqlselect2 = "SELECT score FROM Score_core WHERE id_evaluator = 'O000000001' "
cmd = New SqlCommand()
dsChk.Clear()
daChk = New SqlDataAdapter(sqlselect2, conn)
daChk.Fill(dsChk, "Score_core")
With cmd
.CommandType = CommandType.Text
.CommandText = sqlselect2
.Connection = conn
dr = .ExecuteReader()
End With
dr.Read()
If dr.HasRows Then
score = CDbl(dr(0))
End If
dr.Close()
Tag : .NET, Ms SQL Server 2008, VBScript, Web (ASP.NET), VS 2008 (.NET 3.x)