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 property “public bool arquivoCarregado { get; set; }” does not mantain the status. Why
Tag: c#
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
Can’t find MySql.Data.MySqlClient.MySqlException insert query error
This is the error message MySql.Data.MySqlClient.MySqlException: ‘You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ””)’ at line 1′ this is my query I’ve been looking over at it for over an hour now and I still get this error. Answer It is recommended
Query not executing as expected, returns -1 no matter what
I’m working on a user login system for a semester final. I am using C# in Visual Studio with ADO.NET. I have a query that I use on a database table named Credentials: SELECT * FROM Credentials WHERE …
Why am I getting insufficient parameters supplied to the command error?
I have trying to read a database and display it into a datagridview, but I keep getting the error, using Windows Forms and SQLite: That’s the code I’m using, but what is the issue? I have tried removing the concatenation, and I’ve tried changing the parameters method too: I tried with and without the executenonquery() each time. Answer I have
SQL Multiple queries at the same time creating deadlock (UPDLOCK)
So I have a problem with my database giving me a deadlock. System.Data.SqlClient.SqlException : Transaction (Process ID 57) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I have a project that starts to run and then splits into x amounts of instances that run parallel (usually between 4 and
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 got errors. Any ideas! Answer I
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 purposes.
Winforms, can I use a text box here instead of a combobox? (dropdown list with over 15k options)
For the last few weeks I’ve been building a product demo for work which includes a winform to enter new customer enquiry information. One of the form elements is a text box which, for the sake of ease, I haven’t imposed any validation on so far. However, I now need to make it so that the user can only enter