Posts by Thiago Pires • 361 points
13 posts
-
0
votes1
answer42
viewsA: Mongodb - Find sales containing two products
The solution I found was the following: db.collection.aggregate([ //Primeiro filtro pelas vendas que contenha um dos produtos {$match:{$or:[{id_produto:9},{id_produto:20}]}}, //Agrupo pelo id da…
mongodbanswered Thiago Pires 361 -
0
votes1
answer42
viewsQ: Mongodb - Find sales containing two products
I am a beginner in Mongodb and would like help with the following question. I have a Collection that has the following structure: {[{id_venda:1, id_produto:20}, {id_venda:1, id_produto:3332},…
mongodbasked Thiago Pires 361 -
1
votes2
answers269
viewsA: Return last record from table
As @Leando said, it’s here : Ultimo = Convert.ToInt32(dr["Cod_Item"]); When using MAX you must name this field in order to retrieve it. In this case I believe that you could access positionally…
-
0
votes3
answers196
viewsA: Query listing the dates
I believe you can use this function: The function in the case returns the day of the week, 7 is Sunday. date is my column containing the dates. SELECT EXTRACT(ISODOW FROM data_admissao) FROM…
-
1
votes1
answer84
viewsA: Relationship model and entity
Here are the tables I created to illustrate. Please disregard the names, since I did a little running. Here I create my artist table CREATE TABLE artistaMusica( id_artista SERIAL, nome VARCHAR(10),…
-
0
votes1
answer296
viewsA: I cannot use the Date field. I am using Asp.Net C# MVC
You are passing the value in which format? If this format => "01/01/2017" is incorrect. First you need to format for this = "2017-01-01" and then you can assign. Here’s an example of how to use.…
-
10
votes3
answers2216
viewsA: How to reverse an integer?
A solution would be to use this function I created: public static void Inverter(int numero) { string valor = numero.ToString(); string resultado = ""; for(int i = valor.Length; i >0; i--) {…
-
0
votes1
answer33
viewsA: Doubt about sum of information
The problem is simple, you forgot to reset your variable registromostrar2 import javax.swing.JOptionPane; public class JavaApplication5 { /** * @param args the command line arguments */ static final…
-
3
votes2
answers230
viewsA: Is there a difference between the use of the underscore and the . this?
Your code is correct class Pessoa { private string nome; public Pessoa(string nome){ this.nome = nome; } } o . this will always reference the internal class property. Answering your question about…
c#answered Thiago Pires 361 -
0
votes2
answers241
viewsA: Validation in Edit and Delete operations by ID at url
This is because you are working with the GET method. The method GET : 1024 character capability, this method is used when you want to pass little or no information to perform a search or simply pass…
-
0
votes2
answers309
viewsA: Integration between Console Application, Webservice and Frontend Web C#
I don’t know if I understand your question exactly, but come on. First point: 1-I don’t know how to make the "RUN" button generate an action (run the algorithm) on the server side. Answer: You can…
-
0
votes4
answers449
viewsA: When the textbox is null, the button will be off
Just by complementing the Isac response, it might be interesting to add the method Trim() at the end, if you do not want the button to be enabled only with the space key of the keyboard: private…
-
2
votes1
answer46
viewsA: Arraylist: Is that right or is there a better way to do it?
In c# you must use the type List<tipo> which works basically like Arraylist in Java. In c# Arraylist is marked as obsolete. Arraylist was available before generics were implemented in . NET…