I have a form with values
Price <input type="text" name="items[price]" value="" /> <br />
Condition <input type="text" name="items[condition]" value="" /> <br />
Brand <input type="text" name="items[brand]" value="" /> <br />
I want to send this to database
string[] allitems = Request.Form["items"];
var db2x = Database.Open("mystring");
foreach (var item in allitems)
{
var insertCommand2x = "INSERT INTO Classifieds_attr_value (AttrId,CarBikeId,AttrVal) VALUES(@0,@1,@2)";
db2x.Execute(insertCommand2x, AttrId, CarBikeId, AttrVal);
}
This is not working pls help
You should have to use
items
value for allinput
and read values viaRequest.Form.GetValues("items")
method.and read values,
Or choose different value for name attributes.
and read key-value,