asp.net - Out of Memory exception in the String C# -


i creating asp.net web api service end point return bulk data oracle database. converting returned data in json format. working fine, getting error saying out of memory exception in string result.

  public httpresponsemessage getdetails([fromuri] string[] id)     {         using (oracleconnection dbconn = new oracleconnection("data source=j;password=c;persist security info=true;user id=t"))         {             var inconditions = id.distinct().toarray();             var srtcon = string.join(",", inconditions);             dataset userdataset = new dataset();             var strquery = @"select * stcd_prio_category stpr_study.std_ref in(" + srtcon + ")";             oraclecommand selectcommand = new oraclecommand(strquery, dbconn);             oracledataadapter adapter = new oracledataadapter(selectcommand);             datatable selectresults = new datatable();             adapter.fill(selectresults);             string result = jsonconvert.serializeobject(selectresults);             string contentdisposition = "inline; filename=provantisstudydata.json";             //byte[] byteinfo = encoding.ascii.getbytes(result);             httpresponsemessage response = request.createresponse(httpstatuscode.ok, result, mediatypeheadervalue.parse("application/json"));             response.content.headers.contentdisposition = contentdispositionheadervalue.parse(contentdisposition);             //response.content.headers.contentlength = byteinfo.length;             return response;    }  } 

above code using. not sure why geting exeception suddelny , why working. appreciated.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -