Multiple TextBoxes - Insert into SQL

  • Thread starter Thread starter harrys
  • Start date Start date
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
 
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
 
Back
Top