0

My api controller looks like:

[System.Web.Http.HttpGet]
[System.Web.Http.HttpPost]
public DataTable Get()
{
   DataTable t = new DataTable("t");
   using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
   {                    
     adapter.Fill(t);                 
   }
  return t;
}

And my angular api service requests data from the api:

// contoller
$scope.getReport = function () {
        apiService.post('/api/test/get', null,
        getReportLoadCompleted,
        getReportLoadFailed);
}

 function getReportLoadCompleted(result) {
        $scope.report = result.data;
}

// api service
 function post(url, data, success, failure) {
        return $http.post(url, data)
                .then(function (result) {
                    success(result);
                }, function (error) {
                    if (error.status == '401') {

                        $rootScope.previousState = $location.path();
                        $location.path('/login');
                    }
                    else if (failure != null) {
                        failure(error);
                    }
                });
    }

When api returns data within 60 columns and 200.000 rows, it'ok, no failure, result.data is array of 200.000 row. But when api return data within 60 columns and 250.000 rows, it's ok but result.data is empty string.

What is the problem? Any idea about this?

1

1 Answer 1

0

You should configure your end-point app.config. for example;

<bindings>
    <basicHttpBinding>
        <binding name="basicHttp" allowCookies="true"
                 maxReceivedMessageSize="20000000" 
                 maxBufferSize="20000000"
                 maxBufferPoolSize="20000000">
            <readerQuotas maxDepth="32" 
                 maxArrayLength="200000000"
                 maxStringContentLength="200000000"/>
        </binding>
    </basicHttpBinding>
</bindings>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.