I have a ajax call that returned a 200. I have a webservice that I want to save certain fields from the string I want to save into certain columns and the whole string into another column.
Is there a way to make the string use-able so I can get at each item or make an object from the string.
When I hover over the data(word) in the web method:(debugging)
[WebMethod]
public string InsertformData(string data)
{
I get the JSON string:
data = "[{\"name\":\"formType\",\"value\":\"solarPV\"},{\"name\":\"inp-membershipNumber\",\"value\":\"1\"},{\"name\":\"inp-company-name\",\"value\":\"acme\"},{\"name\":\"inp-representative\",\"value\":\"dw\"},{\"name\":\"inp-position\",\"value\":\"dd\"},{\"name\":...
I want to be able to save to this: or something workable.
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText =
@"INSERT INTO tblFormData(formType, formAssessmentID, formDate, formContent) VALUES(@formType, @formAssessmentID,@formDate, @formContent)";
cmd.Parameters.AddWithValue("@formType", data[0]);
cmd.Parameters.AddWithValue("@formAssessmentID", data[1]);
cmd.Parameters.AddWithValue("@formDate", data[6]);
cmd.Parameters.AddWithValue("@formContent", data);
How would I convert the string to useable objects?