Relative Content

Tag Archive for asp.net-core

Data Paging Cast Object of type System.Int64 to type System.Int32

I have having trouble with this data paging script. I get the error System.Int64 to type System.Int32. The logs do not say anything useful. Call Stack has nothing. This line long long totalRecipes = await recipesQuery.LongCountAsync(); should show Int64. I have tried different ways of coding but no luck still say the same error message.

How to select from two tables using LINQ statement?

[Route(“Mode”)] [HttpGet] public object Mode() { string query = “Select Sum(c.total) as Total, Sum(h.Qty) as Qty, Sum(c.Amount) as Amount, Count(c.Item) as Count, ” + “c.Item, c.Model, h.Date From Cart c Left Join House as h On c.Id = h.Id Group By c.Item, c.Model, h.HarvestDate “; DataTable dt = new DataTable(); string sqlDataSource = _configuration.GetConnectionString(“DefaultConnection”); SqlDataReader […]