c# - JObject formatting (json.net) -


i'm trying tables json string (just example)

  datatable table = new datatable();   table.columns.add("name", typeof(string));   table.rows.add( "david");    var result = row in table.asenumerable()        select new        {  name = (string)row["name"] };   jobject json = jobject.fromobject(new                                  {result});   return json ; 

i'm getting :

"table":{"result":[{"name":"david"}]} 

but need this:

"result":[{"name":"david"}] 

is there ways format string , rid of "table"/"result"/etc, combining them in 1 ? (may not json.net?)

i figure out. needed use jsonconvert.serializeobject instead of jobject


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -