|
-
Feb 24th, 2004, 09:21 PM
#3
Thread Starter
Member
Thank You Lethal.
Now i'm trying the other way which you told me... it does not have error but does not delete the users. Can point me my where is my mistake? Thankz...
here is my coding:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim conn As OleDbConnection
Dim objCmd = New OleDbCommand
conn = connectToDB()
objCmd.commandtext = "spGetMembers"
objCmd.CommandType = CommandType.StoredProcedure
objCmd.connection = conn
Dim myDataReader As OleDbDataReader
myDataReader = objCmd.ExecuteReader
dgDelMember.DataSource = myDataReader
dgDelMember.DataBind()
conn.close()
End Sub
Private Sub dgDelMember_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgDelMember.ItemCommand
If CType(e.Item.FindControl("chkMemDelete"), CheckBox).Checked And e.CommandName = "DeleteButton" Then
Dim conn As OleDbConnection
Dim objCmd = New OleDbCommand
conn = connectToDB()
objCmd.commandtext = "spDelMembers"
objCmd.CommandType = CommandType.StoredProcedure
objCmd.connection = conn
Dim myDataReader As OleDbDataReader
myDataReader = objCmd.ExecuteReader
dgDelMember.DataSource = myDataReader
dgDelMember.DataBind()
conn.Close()
End If
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|