Posts by Leonardo Buta • 1,078 points
34 posts
-
1
votes1
answer45
viewsA: Javascript is not relating in HTML
The problem is located in the part where the request is sent. You need to put the request.send() out of Function onload, for the onload is only executed after the call is completed. Your code will…
-
0
votes1
answer237
viewsA: How to insert values that have "," as decimal separator?
One way to solve your problem is to create a Viewmodel and change the attribute to string by converting to the Product class in the controller, so you can validate your field without touching your…
-
0
votes3
answers893
viewsA: Javascript - User Data
To make it easier, you can create an array of objects by passing the students' data in a single variable, and later traverse it in its function. To declare multiple users in a single variable of…
javascriptanswered Leonardo Buta 1,078 -
0
votes1
answer56
viewsA: Update oracle via c#
Create an index in your column where you are doing Where (CDA_X_USUARIO), that will improve the performance of your update. CREATE INDEX IX_CDA_X_USUARIO ON cda_f_usuasetor (CDA_X_USUARIO) Your code…
-
1
votes1
answer515
viewsA: function js calling twice
It is calling twice because you have registered multiple events in your function. The way you did, you’re calling the event onkeydown, that when calling its function, records the event of focusout,…
-
0
votes1
answer70
viewsA: Why is it that when I do "commit," my project is full of errors?
This doesn’t happen specifically in the commit, but when you push or pull. The reason is that you have a different version of the repository, and someone made changes to the code in the same part as…
-
1
votes2
answers53
viewsA: Input with less than three characters triggers function
To get the characters, you need to add the .length at the end of .value, which will return the number of characters in your input, thus: var caracteres =…
-
2
votes1
answer340
viewsA: Unable to install Npgsql 4.1.2 package. application . NET Framework
This error occurs when the package has a dependency on a specific version of . NET Framework where your project does not have. Your project is in version 4.5.2 and according to the package on the…
-
1
votes2
answers331
viewsQ: What should I return in an Httppost and Httpput in an API?
I am doing an API in . NET Core and I have a question in what I should return in the methods Httppost and Httput, as below: // POST: api/Product [HttpPost] public async Task<IActionResult>…
-
1
votes3
answers621
viewsA: Change Asp.Net Core version
First, you need to see if the desired version of . NET Core is installed. To do this, open the command prompt (cmd) and type: dotnet --info All versions of the SDK you have installed on will appear:…
-
1
votes2
answers603
viewsA: Sending Email with Java
I believe it may be a block of Gmail related to less secure accesses, a Google security policy that blocks the sending of Email in your application. Try this on your Gmail account: 1 - Access your…
-
0
votes1
answer237
viewsA: How to update a document within another document without deleting previous data in Mongodb?
To add elements to an array in Mongodb, you can use the operator $push $push The $push Operator appends a specified value to an array. Reference You will pass the id of his document and the operator…
mongodbanswered Leonardo Buta 1,078 -
0
votes1
answer30
viewsA: $sum returning value 0
How do you want to use a field of your document in the aggregate, you need to put the prefix $, getting $quantidade. According to the documentation mongodb: field path Path to a field in the…
-
3
votes2
answers301
viewsA: SELECT LAST_INSERT_ID() always returns 0
You need to execute the command right after Insert, so it will be within the same execution and ensure that it returns the correct ID. Your code will look like this: public async void…
-
1
votes3
answers3959
viewsA: INSERT INTO NOT EXISTS
You need to give an alias for each column of your select, because the error says that the columns have equal names. The result will be like this: INSERT INTO `pagina_extra` (`ID_PExtra`,…
-
6
votes1
answer120
viewsA: Search for array containing string and number
Like your array is composed of string and the numbers then you can do as follows: 1 - Find the state index with the function index. 2 - Get the following numbers from the state position until there…
-
2
votes2
answers475
viewsA: SQL - Bring the name of the city with the highest number of sales
If you want to bring the name of the city where you got the most sales, based on the sum of the total values, regardless of the quantity of sales, you can use the function SUM: SELECT C.Cidade,…
sqlanswered Leonardo Buta 1,078 -
5
votes4
answers197
viewsA: Correct syntax way in object instance
It depends on your need or ease you wish to have. The first one will instantiate the class with the default values of the properties (0 for int, 0.0 for double, false for Boolean, etc). The second…
-
4
votes1
answer94
viewsA: Problem searching (Firstordefault) - Linq
As explained in the comments of the question, the problem is not the LINQ and yes in the search made, because in the line of your bank, as the image, the column "Emp_codigo" is null, but is being…
-
2
votes4
answers153
viewsA: Public Static Void Does Not Work Properly - NETBEANS
It is necessary to call your code inside the main method, because it is based on it that your application will start running your program, example: public static void main(String[] args) {…
javaanswered Leonardo Buta 1,078 -
7
votes1
answer521
viewsQ: How to correctly multiply the decimal type in C#?
I’m multiplying monetary values in C#, and for that I’m using the type decimal to store these values. I have noticed that in it there is a method called Multiply(), which receives two values and…
-
2
votes2
answers99
viewsA: Select Textarea Text with Variables on Click
You can do it the way you put it, passing the desired elements as parameter, only you must put them in the same parameter separated by a comma, staying as follows: $(document).on('click',…
-
10
votes2
answers3945
viewsA: Javascript usage of ${variable}
This is a specification of Ecmascript introduced in its version 5 as strings template, and from version 6 is called literals template. Its main function of literals template is the ease to mount…
-
1
votes3
answers1008
viewsA: How to put a link inside a String?
There are three ways you can do this by placing a " " (bar) in the desired character, starting the string with single or double Quotes or using template literals (template strings). The first way is…
-
1
votes1
answer35
viewsA: Conversion c# wpf Icollection and Observablecollection
You can use the constructor that receives a Ienumerable as a parameter and pass your collection to convert. Would look like this: ICollection<MyClass> listaCollection = new…
-
4
votes1
answer118
viewsA: How do I differentiate between foreign and national Fps in javascript?
The CPF of Brazilians and foreigners has the same number of digits, so the validation will always be the same and there is no way to differentiate them based only on the numbering. I believe that…
-
2
votes3
answers98
viewsA: Sort select displaying something at the end after sorting
You need to sort by status and then by descending index column. Your query would look like this: SELECT t1.indice, t1.pessoa_id, t2.sts FROM tabela1 t1 INNER JOIN tabela2 t2 ON t1.pessoa_id =…
-
1
votes3
answers82
viewsA: Problem recognizing this.id in jQuery
You need to put the text in a TextArea first, and then do the .select() in the element itself, and not in the value that will be copied. First place an invisible Textarea on your page: <textarea…
-
3
votes2
answers936
viewsA: Check if an array is empty with Vue.js
You can make a .length in the array, in case when there is no element, the div. Thus: <div v-if="job.tags.length">
-
2
votes2
answers803
viewsA: Error in assigning a value to a variable
By its algorithm posted, it will not work because it is missing the declaration of the variable n1 and N2, and that is not allowed accent in SENAO and ENTAO. As to the reason for the error cited, it…
-
4
votes2
answers74
viewsA: Typing
As you commented that you are using the Entity Framework, you can do one of the following: 1 - Assigning type in Model: [Column(TypeName="Date")] public DateTime Data { get; set; } 2 - Using the…
-
2
votes2
answers81
viewsA: How to get multiple Abels to have a randomly generated number
You must use the variable lbl inside the foreach, as it will represent each label of your form. Also, it is recommended that you create the instance of the Random class outside of your loop, as you…
c#answered Leonardo Buta 1,078 -
0
votes3
answers386
viewsA: Change tab title with script, how do you do?
Hello, You can change the title of the page by assigning a new value to document.title, and to pick up the text inside the <h1> just get from the property innerText, as follows: document.title…
-
2
votes1
answer119
viewsA: SQL SCRIPT WITH ERROR
Hello, In the script there are two errors: 1 - A comma is missing between each Constraint statement in the registration table creation. 2 - In the registration table, in the Constraint fk_Classe, he…