Can I delete a user using FormView?

A

AAaron123

I know there is a Membership.DeleteUser but how can I delete a user using
FormView?

I know I have to insert a DeleteCommand into the SqlDataSource but the
UserID is in the Membership and the Users tables (maybe others?) and I don't
know how to insert two DeleteCommand's into the SqlDataSource to delete a
row from each table.



Can I delete using FormView?



Thanks
 
C

Cowboy \(Gregory A. Beamer\)

You will have to circumvent the drag and drop functionality, of course.

Capture the delete on the formview and run Membership.DeleteUser. It is much
easier than writing custom code to clean up multiple tables. You are in
control here, as you write the code in the delete event handler.

--
Gregory A. Beamer
MVP; MCP: +I, Se, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

*************************************************
| Think outside the box! |
*************************************************
 
A

AAaron123

Sound much more error proof too.

Thanks

Cowboy (Gregory A. Beamer) said:
You will have to circumvent the drag and drop functionality, of course.

Capture the delete on the formview and run Membership.DeleteUser. It is
much easier than writing custom code to clean up multiple tables. You are
in control here, as you write the code in the delete event handler.

--
Gregory A. Beamer
MVP; MCP: +I, Se, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

*************************************************
| Think outside the box! |
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top