Skip to content

Tag: c#

Method returns a value but the property does not hold it

The method LocalizaArquivo() calls the method VerificaArquivoCarregado() that checks if the file is already loaded. If it is loaded returns arquivoCarregado = true. When I debug it, I can see that arquivoCarregado = true, but after the method VerificaArquivoCarregado() is finished it changes to false. The pro…

Linq Find the most recurring record

I have a rent a car project. This is the table where I keep the rented vehicles I want to find the most rented vehicle in this table. How can I do this? So I want to find the most mentioned car Id in the table [I have to do it with context architecture. How can I do this with

Passing integer value from textbox in SQL select statement

I have an integer in a textbox(Integer retrieved from another form using TOstring) I want to use in an sql select statement. For example, select * from table where column = textbox. The problem is, npgsql gives an error saying I’m trying to pass string into integer column. I try to cast(::int) but still…

Calculate time in List without using a loop

Is there a way to calculate the data on my List without using loop? My concern right now is it takes longer to process the 5000 ids of employee with different LogIn and LogOut using for loop in a week. What i’ve done is the data is uploaded from csv to the database. Once all the data is uploaded i

CosmosDB count using OrderBy multiple conditions

I am using Azure CosmosDB, the model contains Id, and creationTime properties. What I am trying to do is count entries within time interval. I looked how to achieve it using LINQ but could not find a solution. What I used than is SQL. This is what I tried: Bare in mind the values i showed are for display purp…