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?