Posts by Thiago Araújo • 503 points
27 posts
-
5
votes2
answers134
viewsA: EF Core - Pass parameter with integer list
Two questions I can consider in your code: int[] seller_id = new int[gestorVendedor.Count]; Change to: var seller_ids = gestorVendedor.Select(x => x.Id).ToArray(); To make the query I would not…
-
1
votes2
answers55
viewsA: Use Relative Form in Usercontrol
It’s a little complex to answer the question without understanding the whole context. But what I suggest is that the creation part of the form is on behalf of those who use the UserControl.…
-
1
votes2
answers108
viewsA: Consultation with grouping
Answering your question of when List was implemented: Added in version 2.1 Highness in version 2.5 For more information you can see on firebird documentation Smart to have helped…
-
1
votes1
answer101
viewsA: Persist data in related tables (1 x N)
Márcio, I work with Entity Framework Core, there is a certain difference but I believe it can help you solve your problem. However, consider using EF Core, especially if it is a new project. See…
-
0
votes1
answer46
viewsA: Update main form after closing the load form
I use something similar, I have a form that displays a gif image with a message to wait for the client. What I do in this case is to open the waiting form with .Show() and not ShowModal(). And when…
-
0
votes1
answer156
viewsA: Entity Framework Core - Composite Key
Primary key value change is a practice that is not recommended by the Entity Framework. When it comes to database architecture changing the registry identification is a misconception. Correct is to…
-
2
votes2
answers207
viewsA: Use different screen resolution according to the monitor
Windows Forms has certain limitations for creating responsive forms. In these cases of resolution I always build the forms in the lowest resolution that the system will run and I use the anchors and…
-
3
votes5
answers146
viewsA: Is there a disadvantage or is it harmful to use null types?
C# is a language strongly tipada and this ensures consistency of code avoiding many errors at runtime. Nullables types are extremely important for this consistency. For example, you are doing a sum…
-
0
votes1
answer40
viewsA: How do I pull the CAPTCHA Poup with Javascript into my form in my ERP management system?
Luciano, you can not only get the captcha of the page but you can display every page for the user inside a Webbrowser and work the events of this browser and already fill the content you want as…
-
2
votes1
answer186
viewsA: Why is EF Core updating data from other tables?
Amadeu, the values of the other tables are being changed because you are changing. When you make this command: anuncioActualizado.Raca.Nome = _context.Raca.Where(x => x.Id ==…
-
2
votes1
answer119
viewsA: Convert Iqueryable to a type
As Mauro said in the comment, there is a statement error of itens. Note that the return on Tolist is a list of OrderItem and not an element. You can correct in two ways: List<OrderItem> itens…
-
0
votes1
answer165
viewsA: Like search with LINQ using array
Caique, researching about your problem I found that solution (in English) In your case it would be applied in this way: itens = itens.Where(x => codigosProdutoFabricante.Any(z =>…
-
0
votes1
answer94
viewsA: Grouping of values
It’s a bit complex to understand your business itself, but what you want is to make a return with cross-reference of information. For this you must have a model that adapts to this idea, for…
-
0
votes1
answer535
viewsA: How to search data in any column of datagridview, after popular it by the c#database
Gustavo, I would change the way you work in two points: First, change the way you work with the grid, don’t add the lines manually, use the Datagridview Datasource to populate it:…
-
0
votes1
answer118
viewsA: Map a table and enable Auto-increment of a FK field in Postgre using EF Core and Fluent Api
I have similar cases that work auto increment, but in my tables the primary keys are of type Guid (UUID). Researching about your problem the Npgsql in Value Genaration asks to enable the option…
-
0
votes2
answers44
viewsA: Return the Dbquery property name using Generics
Ronaldo, If you are using within a generic class, the name you have from: typeof(T).Name; In that context something like: DataContext.Query<T>().FromSql(typeof(T).Name); I’m not sure I…
-
0
votes1
answer299
viewsA: Change float field to decimal
The acceptance of changes to the DDL structure of the database by Migration will depend greatly on the database. If I’m not mistaken, structurally fields float are larger than double and such…
-
0
votes2
answers98
viewsA: Layout ratio difference between Form1.Cs[Design] and . exe
Note in the method InitializeComponents() if the configuration below has been inserted: this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; Change to: this.AutoScaleMode =…
-
1
votes1
answer27
viewsA: Data update issues with Entity Framework with relational data
Lucas, you are starting the context within the method, in which case the Entity does not recognize the entity original. Try to find the original entity and set the values on top of it using the…
-
1
votes3
answers1299
viewsA: Should every table have Primary key?
Nelson, the two answers are very complete. I will add a remark here regarding Nosql database. Nosql Bank work in a completely different way from relational banks and, depending on the context, you…
-
0
votes4
answers1003
viewsA: Problem saving a change using Entity Framework
First of all, by error message the problem may be na directly in the Measurement Unit Id. But I make three observations that you can consider: 1 - Note that you may be working with different…
-
1
votes3
answers1009
viewsA: How to make a Useful days rule in Asp.net and C#?
i implemented something very similar to what you want. I have a method to catch the next business day of a certain date. Follow the code: /// <summary> /// Pega o próximo dia útil da data…
-
1
votes1
answer160
viewsA: A3 Web Application and Token without Local Installations
Diego, I basically go through the same problem. After doing a lot of research, I chose to use only A1 certificates in cloud system cases. My conclusion was this: If my API or service is running on…
-
0
votes1
answer332
viewsA: Error Performing Update on Entity Framework Core
When you have a model that is disconnected from context (or was searched for by another context) Entity does not have the Tracking of this model. In this case the best means (or at least what I use…
-
3
votes2
answers560
viewsA: How to improve the performance of the Linq query?
The problem is not with Linq itself, but with the way you are doing the query in the database. If you are working with Entity, see output of your debug the SQL being generated and try to run it…
-
3
votes1
answer131
viewsQ: Aspnet Core API with Entityframework Core - Disconnected Entiades
My scenario is the following: I have an Aspnet core API that uses Entityframework for data access (postgree database). When I receive content in Json by the API (Put) and need to update the template…
-
0
votes1
answer74
viewsA: How to simulate the click of a button with httpWebRequest
I do something similar using Webbrowser to take an element of an HTML and invoke the click of it. Example: var botao = webBrowser.Document.GetElementById("id_do_botao");…