Hi guys I am taking values on a page. Clicking on a save button and on the click event want to open up a grid to show values depending on the search made. So i need to transfer these values from search page(on which im taking these values) to the page on which i want the search function to run and display the grid. I did it with the Session state but its not working and giving me this error.
Note that the error looks like this entirely : at line 4
on the DESTINATION FILE CODE
the page on which im taking the values the code behind looks like this---------------
searchFields["PaymentId"] = txtPaymentID.Text;
searchFields["TOLNumber"] = txtTOLNumber.Text;
searchFields["ReferenceNumber"] = txtRefNumber.Text;
searchFields["ContractNumber"] = txtContractNum.Text;
searchFields["LastName"] = txtCustLName.Text;
searchFields["FirstName"] = txtCustFName.Text;
searchFields["CCFirst6"] = txtCCFirst6.Text;
searchFields["txtCCLast4"] = txtCCLast4.Text;
// HERE I AM TAKING THE VALUES ABOVE IN A SESSION AND PASSING IT ON OTHER PAGE
Session["SearchCriteria"] = searchFields;
Destination page looks like this -----------------------
Hashtable searchFields = (Hashtable)Session["SearchCriteria"];
int paymentID = searchFields["PaymentId"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["PaymentId"].ToString());
int tolNumber = searchFields["TOLNumber"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["TOLNumber"].ToString());
int referenceNumber = searchFields["ReferenceNumber"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["ReferenceNumber"].ToString());
int contactNumber = searchFields["ContractNumber"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["ContractNumber"].ToString());
string firstName = searchFields["firstName"].ToString();
string lastName = searchFields["LastName"].ToString();
int txtCCFirst6 = searchFields["CCFirst6"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["CCFirst6"].ToString());
int txtCCLast4 = searchFields["CCLast4"].ToString() == "" ? -1 : Convert.ToInt32(searchFields["CCLast4"].ToString());
THE THE SQL part ----------
SqlParameter[] para = new SqlParameter[] { new SqlParameter ("@Payment_ID", paymentID),
new SqlParameter ("@TOLNumber", tolNumber),
new SqlParameter ("@ContractNumber", contactNumber),
new SqlParameter ("@CustFirstName", firstName),
new SqlParameter ("@CustLastName", lastName),
new SqlParameter ("@CCFirst6",txtCCFirst6),
new SqlParameter ("@CCLast4", txtCCLast4),
//// //new SqlParameter ("@TransactionID", TransactionID),
};