Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Adding data to the database

  1. #1
    kdalal is offline Member
    Join Date
    Aug 2009
    Location
    USA
    Posts
    50

    Default Adding data to the database

    I have made one custom page from which i want to add the email address to the database.How can i do that?

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    It completely depends on where/how you want to add it. Is this a custom table or one of the native AspDotNetStorefront tables? Is this just storing an email address or are you trying to create customers or somehow tie this email address to AspDotNetStorefront functionality? If you can provide more information on exactly what you're trying to do I think the community can offer a bit more assistance.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    kdalal is offline Member
    Join Date
    Aug 2009
    Location
    USA
    Posts
    50

    Default

    It is a custom table and i just want to add an email of customers,they may be not registered as a customer,this is for only those people who want to register for an special offer email list.

  4. #4
    estephen is offline Senior Member
    Join Date
    Apr 2006
    Location
    Dallas
    Posts
    208

    Default

    I generally hate it when people post a "why don't you" answer, but I feel compelled.

    Have you considered using a service like Constant Contact or Campaign Monitor? We use Campaign Monitor b/c there is no monthly fee - we pay on a per campaign basis which is better for us since we don't send emails every month. Both give you all the APIs for subscribing, unsubscribing, etc. Plus powerful list management, user segmentation, double-opt-in, one-click opt-out, etc. Not to mention all the email capabilities, statistics & reporting, and spam protection that is built in to these services.

    For us a bargain at twice the price. Maybe worth a look for you.

    EDIT: A small snippet of HTML is all that's required on your template in its simplest form to have users subscribe via your website. Other pages (such as a "Success" page) via topics, xml packages, or new aspx pages can be added to suit your taste.
    Last edited by estephen; 09-10-2009 at 08:23 AM.

  5. #5
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Excellent suggestion estephen, and thanks for the insight. Generally integrations of this sort are a good alternative to writing the whole thing from scratch (unless it's an integration requiring specific modifications that could only be accomplished by writing it yourself).

    Updating the database is simple, you can just use a DB.ExecuteSQL call that takes a sql query string as a parameter to update the database. You just need to make sure that you check all user input that may be going into the database to prevent sql injection attacks/vulnerabilities.
    Code:
    DB.ExecuteSQL("your sql query to update the database here");
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>