473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

looking for a simple solution

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
Sep 14 '06 #1
1 1148

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

Sep 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ed Cox | last post by:
Hi, first time poster to this group looking for a little help. Knowing that there are hundreds of php applications and solutions out there, and I don't want to re invent the wheel, I am looking...
22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
2
by: David Winter | last post by:
I'm not a developer myself, but I am looking for something that maybe one of you guys - has done - knows about - would like to do - yes, I have a small budget for this. :) The basic idea: A...
16
by: Fronsac | last post by:
Hi, I've been asked in a job interview how to make C code look like C++ code, and honestly I didn't know what to answer because I have never really done a lot of C. Now, I've been searching around...
3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
2
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I...
1
by: MD | last post by:
Hello I work in a .NET environment and I am about to create a development strategy. As part of this I am looking at implementing a testing tool to fit in with an iterative approach and NUnit...
4
by: Gary | last post by:
I have a status text on my status bar which simply lists the logged in user name. the code that puts text into this is: stUserName.Text = "Currently logged in user: " +...
1
by: MarkW | last post by:
Sometime back I bought a couple books on Dreamweaver and Flash for the CS2 Suite and along with it bought a book for Php, Foundation Php for Dreamweaver 8. I read the Dreamweaver and Flash books...
6
by: beantaxi | last post by:
Hello all, I'm looking for a very simple code analysis tool. I have a large codebase to analyze, and all I really need to do is to find all uses of all methods in a few interfaces. Many tools...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.