looking for a simple solution

Discussion in 'ASP .Net' started by Hayden Kirk, Sep 14, 2006.

  1. Hayden Kirk

    Hayden Kirk Guest

    Hey Guys,

    I have a wizard control which has 3 steps. First step is them entering their
    email address and then me verifying that it is either in the database or
    not. If it's not, then insert it, otherwise send an error.

    I'm having real trouble using the sqldatasource control. I've tried using
    the sqlcommand and sqlconnection with a datareader but I don't know how to
    make a sql query agaisnt a control in the wizard.

    Can someone possibly help with a code example?

    Thanks

    --

    - Hayden
     
    Hayden Kirk, Sep 14, 2006
    #1
    1. Advertisements

  2. Hayden Kirk

    gella Guest

    Hayden Kirk wrote:
    > Hey Guys,
    >
    > I have a wizard control which has 3 steps. First step is them entering their
    > email address and then me verifying that it is either in the database or
    > not. If it's not, then insert it, otherwise send an error.
    >
    > I'm having real trouble using the sqldatasource control. I've tried using
    > the sqlcommand and sqlconnection with a datareader but I don't know how to
    > make a sql query agaisnt a control in the wizard.
    >
    > Can someone possibly help with a code example?
    >
    > Thanks
    >
    > --
    >
    > - Hayden


    hi,
    use this in button click event

    dim con as new sqlconnection
    dim da as new sqldataadapter
    dim ds as new dataset
    dim cmd as new sqlcommand
    dim i as string
    try
    'connect to database
    con=new sqlconnection('ur connection string)
    'search for required email id in database
    da=new sqldataadapter("select * from database where EmailID="&
    textbox1.text &"",con)
    da.fill(ds,"database")
    i=ds.tables("database").rows(0).item(0)
    'if datbase contains the emailid then ,above statement will throw an
    exception
    'else continue inserting

    cmd.commandtext="UR INSERT STMT"
    con.open()
    cmd.executenonquery()
    con.close()
    catch
    response.write("emailid already exists")
    end try

    ...........try out in this process
     
    gella, Sep 14, 2006
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ing. Rajesh Kumar

    Looking for a better solution

    Ing. Rajesh Kumar, May 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    392
    Natty Gur
    May 17, 2004
  2. Kenneth Keeley

    Looking for Web Based Help Desk Solution

    Kenneth Keeley, Jul 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    717
    Amit Adlakha
    Aug 22, 2012
  3. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Solution file not in the solution folder

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,298
    Laurent Bugnion
    Sep 12, 2006
  4. , India
    Replies:
    17
    Views:
    1,391
    James Kanze
    Oct 1, 2007
  5. Replies:
    8
    Views:
    760
  6. email55555 email55555

    [SOLUTION] Ruby Quiz #14 LCD Numbers ( solution #2 )

    email55555 email55555, Jan 9, 2005, in forum: Ruby
    Replies:
    16
    Views:
    452
    David Tran
    Jan 10, 2005
  7. Louis J Scoras
    Replies:
    13
    Views:
    526
    Dave Burt
    Oct 5, 2005
  8. MenTaLguY
    Replies:
    12
    Views:
    494
    MenTaLguY
    Jun 7, 2007
Loading...