Hello Everyone,
I am using a HTML table binded with SQL database server using MVC
I want to carry my HTML table data to be stored in Database for that I am using JSON
MY DB header is inserted as ,
first_name,last_name,first_school
I am displaying my header in HTML table as,
FIRST NAME, LAST NAME, FIRST SCHOOL
on JSON.stringify
[HttpPost]
public ActionResult UpdateCustomer(Customer customer)
{
using (CUSTOMEREntities entities = new CUSTOMEREntities())
{
Customer updatedCustomer = (from c in entities.Customers
where c.CustomerId == customer.CustomerId
select c).FirstOrDefault();
updatedCustomer.Name = customer.Name;
updatedCustomer.Country = customer.Country;
entities.SaveChanges();
}
return new EmptyResult();
}
data: '{customer:' + JSON.stringify(customer) + '}',
I am receving the json result with the name i mentioned in HTML table so in my controller the values are not fetched since the Table headers are not matching.
How to solve this any alternate solutions?