Html Kodlari
<asp:TemplateField><HeaderTemplate>Seçim</HeaderTemplate><ItemTemplate><input id="chk" runat="server" type="checkbox" value='<%# Eval("aid") %>' /></ItemTemplate> </asp:TemplateField>
Arka Plan Kodlari
Dim IDlistesi As String = "" Dim VarMi As Boolean = False For Each row As GridViewRow In GWOnaysizlar.Rows Dim chk As HtmlInputCheckBox = CType(row.FindControl("chk"), HtmlInputCheckBox) If chk.Checked Then VarMi = True IDlistesi &= chk.Value & "," End If Next If VarMi = True Then IDlistesi = IDlistesi.Substring(0, IDlistesi.Length - 1) Dim Conn As New SqlConnection(ConfigurationManager.AppSettings("Conn")) Dim comm As New SqlCommand("", Conn) comm.CommandText = "delete from tabloadi where aid in" & "(" & IDlistesi & ")" If Conn.State = Data.ConnectionState.Closed Then Conn.Open() comm.ExecuteNonQuery() If Conn.State = Data.ConnectionState.Open Then Conn.Close() End If
Yazılım | 1 Yorum | 03.03.2008 09:54:14 Etiketler: Etiket Eklenmemiş