السلام عليكم ورحمة الله وبركاته ..
شباب تحية طيبة وبعد عندي خطاء في هذه الاستعلام لا اعرف ماهو الخطاء فيه
For i As Integer = 0 To DataList1.Items.Count - 1
Dim row As DataListItem = DataList1.Items(i)
Dim rdd1 As Boolean = CType(row.FindControl("CheckBox1"), CheckBox).Checked
Dim txt As String = CType(row.FindControl("label1"), Label).Text
If rdd1 = True Then
Dim x As Integer = 1
sql = "UPDATE table1 SET flag=@flag WHERE student_no=@student_no"
com = New SqlCommand(con, sqlcon)
sqlcon.Open()
com.Parameters.AddWithValue("@flag", x)
com.Parameters.AddWithValue("@student_no", txt.ToString)
com.ExecuteScalar()
End If
sqlcon.Close()
Next
-----------------------------------------------------------------
هذه صورة الخطاء