Multiple TextBoxes - Insert into SQL

H

harrys

Hi,

Just wanted to clairfy if there is an easier way of acheving the
following:

On my page i have ten text boxes. These boxes may or may not have data
entered into them; (This is out of choice, so the requiredfield
validator is no good)

When the user hits the submit button, I want to insert the data into my
SQL database using an Insert statement like below:
INSERT INTO RequestList
VALUES ( RegMail1.Text, RegMail2.Text, RegMail3.Text, RegMail4.Text)

Question is, what is the easiest way to get all of the text box
information into one string for the INSERT statement, whislt at the
same time removing any entries that are null? (Usually at least one or
two of the text boxes will have no information in it.

Thanks in advance
H
 
P

Patrick.O.Ige

harry,
You can just do it in sql using store procs
check if the param isnull and if it in don't insert the value.
Hope that helps
Patrick
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top