locked
Managing Members RRS feed

  • Question

  • User1628746328 posted

    hey there...

     is there a way to manage members in the Classified app as can be done with Ads?

    IE: update, delete?

     thanks so much!

     

    doug

    Thursday, December 18, 2008 5:59 PM

Answers

  • User730446648 posted

    I started with this tool.

    See the bottom of the first post, there is a link to a user.cs file

     http://forums.asp.net/t/1110595.aspx

    As is the file mentioned above does work to apply yourself as admin ad remove the member.
    However, when using the tool it only removes the member from the members database.
    It does not remove the member from the classifieds database in the members table.

    For this to work completly, I converted it to vb, and added some code for the removal process.

    It's pretty easy though, just make a new stored procedure.

    You need to start with the user file you use for managing your members.

    When it runs through and deletes them member tell it to get the username you want to delete.

    MembersDB.RemoveMemberFromDatabase(ListBox1.SelectedValue)

    That line above tells it to go into App_Data/BLL/Members.vb
    and looks for a sub your about to create, RemoveMemberFromDatabase
    Save this sub below in App_Code/BLL/Member.vb

    Public Shared Sub RemoveMemberFromDatabase(ByVal UserName As String)

    Using db As New MembersDataAdapter()

    db.RemoveMemberByUsername(UserName, "/")

    End Using

    End Sub

    That sub tells it to look in App_Code/DAL/Members.xsd

    I like to go into the code itself, and I just copied insertmember,
    delete the entries, only leaving the top three.
    THE TOP THREE NAMES BELOW ARE ABBREVIATED.

    RETURN

    ASPNETusername

    ASPNETAPPNAME

    Since you copied, don't forget to change ALL insertmember (in your copy) to RemoveMemberByUsername

     

    Now it looks for your stored procedure.

    Here's one I wrote.

    ALTER PROCEDURE RemoveMemberByUsername @AspNetUsername nvarchar(256),

    @AspNetApplicationName nvarchar(256)

    AS

    DELETE FROM classifieds_Members

    WHERE (AspNetUsername = @AspNetUsername) AND (AspNetApplicationName = @AspNetApplicationName)

    And it should work.
    (Note that I am using the final version so it says my members table is classifieds_Members)
    If you are using beta, just remove "classifieds_"

    Make sure you make a backup before trying new code, and test it out before publishing.

     

    Good Luck

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 18, 2008 9:43 PM

All replies

  • User730446648 posted

    I started with this tool.

    See the bottom of the first post, there is a link to a user.cs file

     http://forums.asp.net/t/1110595.aspx

    As is the file mentioned above does work to apply yourself as admin ad remove the member.
    However, when using the tool it only removes the member from the members database.
    It does not remove the member from the classifieds database in the members table.

    For this to work completly, I converted it to vb, and added some code for the removal process.

    It's pretty easy though, just make a new stored procedure.

    You need to start with the user file you use for managing your members.

    When it runs through and deletes them member tell it to get the username you want to delete.

    MembersDB.RemoveMemberFromDatabase(ListBox1.SelectedValue)

    That line above tells it to go into App_Data/BLL/Members.vb
    and looks for a sub your about to create, RemoveMemberFromDatabase
    Save this sub below in App_Code/BLL/Member.vb

    Public Shared Sub RemoveMemberFromDatabase(ByVal UserName As String)

    Using db As New MembersDataAdapter()

    db.RemoveMemberByUsername(UserName, "/")

    End Using

    End Sub

    That sub tells it to look in App_Code/DAL/Members.xsd

    I like to go into the code itself, and I just copied insertmember,
    delete the entries, only leaving the top three.
    THE TOP THREE NAMES BELOW ARE ABBREVIATED.

    RETURN

    ASPNETusername

    ASPNETAPPNAME

    Since you copied, don't forget to change ALL insertmember (in your copy) to RemoveMemberByUsername

     

    Now it looks for your stored procedure.

    Here's one I wrote.

    ALTER PROCEDURE RemoveMemberByUsername @AspNetUsername nvarchar(256),

    @AspNetApplicationName nvarchar(256)

    AS

    DELETE FROM classifieds_Members

    WHERE (AspNetUsername = @AspNetUsername) AND (AspNetApplicationName = @AspNetApplicationName)

    And it should work.
    (Note that I am using the final version so it says my members table is classifieds_Members)
    If you are using beta, just remove "classifieds_"

    Make sure you make a backup before trying new code, and test it out before publishing.

     

    Good Luck

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 18, 2008 9:43 PM
  • User1628746328 posted

    thanks..

     

    I'll look into it.

     

    Merry Christmas!

     john3:16

    doug

    Friday, December 19, 2008 8:58 AM
  • User1628746328 posted

    thanks!

    that was pretty straightforward and simple to implement..

    that scares me...

     but it seems to work!!!

    thanks!!!

     

    dd

    Thursday, January 1, 2009 12:25 PM
  • User730446648 posted

    Glad you got it.

    Work smarter, not harder.
    That's my creed.

     

    Thursday, January 1, 2009 3:28 PM