注册 登录
编程论坛 ASP.NET技术论坛

Repeat 中的CheckBox不起作用,点更新为什么会全部更新啊?

scindy 发布于 2008-03-27 16:28, 995 次点击
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndelete.Click
        Dim i As Integer
        For i = 1 To Repeater1.Items.Count - 1
            Dim cb As CheckBox = Repeater1.Items(i).FindControl("CheckBox1")
            If Not cb Is Nothing And cb.Checked = True Then
                Dim strsql As String = "update maillist set MFlag='d' where mfrom=(select defaultmail from users where username=" & "'" & Session("username") & "'" & ")" & ""
                Dim cmd As New SqlCommand(strsql, conn)
                conn.Open()
                cmd.ExecuteNonQuery()
                conn.Close()
            End If
        Next
    End Sub
3 回复
#2
wyg48592008-03-27 18:04
不太看得懂VB的语法!
#3
scindy2008-03-28 12:39
有没有人知道啊~~~
麻烦版主解决一下~~`
#4
hebingbing2008-03-28 13:25
回复 3# 的帖子
版主很久没有归隐了,好久没有出来了……
1