looking for a simple solution

  • Thread starter Thread starter Hayden Kirk
  • Start date Start date
H

Hayden Kirk

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 said:
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

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
 

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

Back
Top