Hello there's..
I want to concatenate two json string.
first string contains data tables records details and other string contains Count value.
I get that values In data set such that.
dataset ds.Tables[0]= //table records
ds.tables[1]=// singale integer value (e.g. TotalCount=12)
I convert ds in json but it return json string like.
{"contactList":[{"Name":"Abhijit Goswami","email":"abhijitda@facebook.com","contactNo":"9158417355","gender":"Male"},{"Name":"Abhijit Goswami","email":"abhijitda@facebook.com","contactNo":"9158417355","gender":"Male"},{"Name":"Abhijit Goswami","email":"abhijitda@facebook.com","contactNo":"9158417355","gender":"Male"}],"totalCount":[{"Total":192}]}
In above string I don't want to totalCount value in array.
I just want to "totalCount:192" after the contact list array.
{"contactList":[{"Name":"Abhijit Goswami","email":"abhijitda@facebook.com","contactNo":"9158417355","gender":"Male"},{"Name":"Abhijit Goswami","email":"abhijitda@facebook.com","contactNo":"9158417355","gender":"Male"}],"totalCount":192}
What I have tried:
currently my code for converting DataSet to JSON string as bellow
ds.Tables[0].TableName = "contactList";
ds.Tables[1].TableName = "totalCount";
json = JsonConvert.SerializeObject(ds, Formatting.None);