Further to RK's solution.
RK has suggested one way to store the data in the database.
If there are always 5 options for your questions then a better way could be
QuestID, QuestDescription, Option1, Option2, Option3, Option4, Option5
Assuming you have set up QuestID as autoincrement you could then insert the data like this
SQL = "INSERT into QTable (QuestDescription, Option1, Option2, Option3, Option4, Option5) "
SQL += "VALUES (@desc, @opt1, @opt2, @opt3, @opt4, @opt5)"
This is assuming that you use parameterised queries (you should, to avoid sql injection) - see this link for the rest of the detail
http://www.dotnetperls.com/sqlparameter[
^]
However, you have stated that you want them as separate records - this would give you the advantage that different questions could have a different number of options.
In this case you should have two tables - Questions and Options. The Question table would have
QuestID and QuestDescription
The options table would have (at least)
OptionID, QuestID, OptionDescription
OptionID - not compulsory but recommended - use an Autoincrement column.
QuestID - is the
Foreign Key[
^] to the Questions table
OptionDescription - is the text of the option
You would then just loop through each textbox (you haven't stated your naming convention, you could even just use 5 lines of code and name them explicitly)
SQL = "INSERT INTO Options (QuestId, OptionDescription) VALUES (@questID, @option)"
Later when you are attempting to get the data back out of the database you could use
SELECT QuestID, QuestDescription, Option
FROM Questions Q
INNER JOIN Options O ON Q.QuestID=O.QuestID
WHERE QuestID = @questid
ORDER BY O.OptionID
or use
PIVOT[
^] if you want them all back in a single row
[EDIT] - OP has confirmed he has a separate table for the options (good), and I have looked up the thing that was pestering the back of my mind ... To insert them all in a single query try something like this
INSERT INTO OPTIONS (QuestId, Optiontext) VALUES
(@questID, @textbox1),
(@questID, @textbox2),
(@questID, @textbox3),
(@questID, @textbox4),
(@questID, @textbox5))