Francesco Marrella

Francesco Marrella

  • 1.7k
  • 69
  • 3.3k

Cannot convert jobject element value to string

Mar 20 2018 5:54 AM
public RecuperoStampaCodici(JObject responseSearch)
{
try
{
string code = String.Empty;
string licensecode = String.Empty;
string locationId = String.Empty;
//Scrivo i valori aggiornati di access_token e refresh_token
foreach (var valueJson in responseSearch)
{
if (valueJson.Key.Equals("Code"))
textBoxCode.Text = valueJson.Value.ToString();  //error NULL EXCEPTION
else if (valueJson.Key.Equals("License"))
textBoxLicenseCode.Text = valueJson.Value.ToString();
else if (valueJson.Key.Equals("LocationId"))
textBoxLocationId.Text = valueJson.Value.ToString();
}