Value shown in production other than development

Asked

Viewed 72 times

0

I have an application in ASP.NET MVC with the Entity Framework with an Oracle database, and the same one showing some wrong data, and this happens only in production, in Debug(locally) the data is brought in the right way.

This data is recorded from another system. My system just picks up the data, directly in the database, without API, and shows the data.

This is the function used.

public List<Escala> GetByFunc(int motCodigo, DateTime data)
{
    try
    { 
        return Db.Escala.Where(x => x.MotoristaCodigo == motCodigo && x.Data == data)
                        .OrderByDescending(x => x.Data).ToList();
    }
    catch(Exception)
    {
        return null;
    }
}

Thanks for your help.

  • Normative: always put the code than an image, please! change this code image and put the code itself .

  • 1

    What should you show? and what you’re showing, could improve your question?

  • Aren’t you working with two databases, by chance? An approval and another production? Looking at data from one and taking from another?

  • Thanks for the tips. This Function returns a Drivers Scale, and within this Scale, there is an initial time and an ending, for the driver and date specifies, the value that is coming wrong is the time. Debugging the code brings it right, but in production, brings a different value.

  • No Aline, it’s a base only, we have no test basis for this system.

  • What different value does it bring to time? It could not be the regional settings of the server?

  • No Alina, the time value is already recorded in the right database. In the case the right value is 16:12 but this bringing 5:20, this within the Scale object.

  • is string in the bank?

  • Driver = Number(16), Date = Date, Initial = Number(6), Final = Number(6)

  • The way I see it, the guys are right.

  • Just seems to me you’re getting the wrong record even... There’s some that eh: 5:20 am?

  • Voce ta ordering only by Date .. since what Voce wants is the last time, then you should sort by horario too ...

  • Aline, has many records of 05:20. But there is none on 05/04/2017 that is the day that is giving the problem. And I don’t think I’m getting the record erado because locally the value is brought correctly, but in production comes a value erado.

  • Andre, nothing has changed using the code you have passed, it remains the same, locally brings the correct value and in production brings the wrong value.

  • @Cassioalves you said your field hora is number, how are the data in the database? crudely... 0520 ? 1612 ?

  • The other system from which I pick up the data is recording the data as 982, dai system that I take care of(Already paid it ready) the former programmer makes some accounts to arrive at the value, that in most cases is only to divide this value by 60 that of the 16 with integer, and take the rest and do other math. But this is working well for a long time. So much so that it works right locally.

Show 11 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.