This project has moved and is read-only. For the latest updates, please go here.

Json to object array of DateTime?

Jan 5, 2010 at 5:30 PM


is it possible to convert json



object[] of type Datetime because I this code below to call stored procedures dynamically?

object[] Params = (object[])JsonConvert.DeserializeObject(JSON, typeof(object[])); Type currType = context.GetType(); MethodInfo currMethod = currType.GetMethod(StoredProcedureName); var SPResults = currMethod.Invoke(context, Params);

When it hits the invoke line, it fails giving me this: Object of type 'System.String' cannot be converted to type 'System.Nullable`1[System.DateTime]'.

Any ideas on how to tackle this problem?


Jan 5, 2010 at 11:18 PM

IsoDateTimeConverter + deserializer to array of datetimes + cast to array of objects.