My goal is to set the datasource of a grid to a session variable, bind it, and then add a row or rows to the dataset and save the changes back to the session. However, I am encountering an issue after trying to commit the changes, resulting in an AJAX sync failed error with a null reference exception.
I suspected that the issue was related to the newMarket array not having the correct number of fields, so I tried populating all the fields in the Market array. Despite this adjustment, I still received the same error.
It's worth mentioning that "1" is an identity field, and I thought it was necessary to populate it. Also, the fields after the last "q" are set in the stored procedure. I hardcoded the values in JavaScript for faster testing.
Below is the code snippet:
var newMarket = [1, "q", "q", "q", true, "03/12/2015",
"62F387C7-CC7D-4491-9C71-10EC254F6EB9", "03/12/2015",
"62F387C7-CC7D-4491-9C71-10EC254F6EB9"]
You can find the full code below:
[inserted code snippet here]
The issue might be related to the code below:
[inserted additional code snippet here]
And finally, I am using the following code to handle the data in the session:
[inserted final code snippet here]