I have a form on a page.
The form contains of 3 known fields: Sex Age StoreId
and an unknown number of fields that all begin with "Question_" followed by an ID
I would like to store these fields in my table(MyTable) in db(MyDb). Each record I need stored contains: ID(Int), Sex(String), Age(Int), StoreID(Int), QuestionID(Int), Answer(Int)
Can someone help me get started?
I got:
public ActionResult Index(Questions model, FormCollection form) {
var Age = form["age"];
var StoreId = form["storeId"];
var Sex = form["sex"];
and then I guess i will be using an array getting the last "Questions_" ready for the insert?