This is my code for updating
[HttpPost]
public ActionResult Edit(string id,sample collection1,FormCollection collection)
{
sample p = db.samples.Single(e => e.AccNo == id);
try
{
string[] Values = collection["AccNo"].ToString().Split(new Char[] { '.' });
int b = int.Parse(Values[0]);
int c = int.Parse(Values[1]);
string t = Values[2];
p.BatchId = collection1.BatchId;
p.ProductName = collection1.ProductName;
db.SubmitChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
I want to assign these (
int b = int.Parse(Values[0]);
int c = int.Parse(Values[1]);)
2 vales 2 Table columns like&store to db
p.BatchId = collection1.BatchId;
How can i assign after store table columns these values