Posts by Ronaldo Araújo Alves • 1,954 points
85 posts
-
0
votes1
answer1329
viewsA: Error Code: 1064. MYSQL WORKBENCH
Preco varchar(10,2) varchar accepts one parameter only. I believe what you’re looking for is the guy decimal(10,2)
-
1
votes1
answer150
viewsA: Mysql - Error performing INSERT with FOREIGN KEY
You are using hostname_grupo as PK, and in insert is adding an item in the tb_hosts.hostname whose value does not exist in the referenced table.
-
2
votes1
answer36
viewsA: Pull data from Datagridview to a form
You are assigning the values to the form this.exibirdados, but is instantiating a new ExibirDados and displaying this newly created. Change this: ExibirDados form = new ExibirDados();…
-
1
votes1
answer100
viewsA: Delete programmatically created Labels
You need to add the event DoubleClick in the honeycombs it creates. After raising the label, use the code: l.DoubleClick += L_DoubleClick; And create the event: private void L_DoubleClick(object…
-
2
votes1
answer554
viewsA: Excel cannot locate spreadsheet
Check which directory the S:\ hers.
excelanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers66
viewsA: See table by period
The query below returns the amount of records in PedVend (using the filter EmpCod = 5 and hours between 10:00 and 16:00), grouped by date. SELECT P.PvDatHor, count(*) FROM PedVend P WHERE P.EmpCod =…
-
3
votes1
answer55
viewsA: Left Join - Linq is bringing Duplicate Value
The field TpMdoBC_Codigo table TipoModBaseICMS is not only! Let’s take for example, Code Tax 1. He has the TbImp_TpMdobc value 3. By doing the join with the table TipoModBaseICMS 2 records are…
-
0
votes1
answer74
viewsA: Join that shows multiple data from one id
When using the inner, the rows of the table Third party will be repeated for each occurrence in the other tables. Example: If you make a inner join of Third party* with **Dwelling, if there are two…
sqlanswered Ronaldo Araújo Alves 1,954 -
2
votes2
answers72
viewsA: Execute request when changing value in a select
Use the change() instead of click() EDIT As pointed out in the comments by José Guilherme Oliveira, the ID that receives the data is #cmb_operadora_site, but apparently it should be #cmb_cidade_site…
-
1
votes1
answer170
viewsA: Optimize query. The foreach is too slow
Apparently when you use x.Items.Count the Lazy Loading make a complete query (SELECT * FROM ...) and then use Linq for the counting of records, so the slowness. An alternative is to use a proc to…
-
1
votes1
answer31
viewsA: Save Labels to a file and load information
I ran a simulation and found two problems: When saving, you are overwriting txt. use TextWriter tw = new StreamWriter("SavedGame.txt", true); to give append instead of overwriting the file. You are…
-
3
votes2
answers1278
viewsA: String or Binary data error would be truncated - SQL
This error usually occurs when trying to insert a string bigger than the field can handle. Ex: Codigoaudinuj varchar(6) If you insert a string with 7 characters or more, will give error. In the…
sql-serveranswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers68
viewsA: Foreign Key (foreign key) referencing utility in the database
Integrity and security. When using Foreign Key, we can ensure that no record will be physically added to the table agendar_consulta without a id_user and a id_medico valid. Same goes for deletion:…
-
1
votes2
answers115
viewsA: What is a Nullreferenceexception and how do I fix it?
TL;DR: You are trying to access a variable from an instantiated object. On the line item.Crianca.Nome or the item is null, or the prop Crianca of item is null. Instantiating what is not instantiated…
asp.net-mvcanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers226
viewsA: Error in program c# with vectors
Vector indices range from 0 to n-1, being n the size. Therefore, int[] vetor = new int[3]; will have the items vetor[0], vetor[1] and vetor[2] Your for goes from 1 to x.Length, then when you reach…
c#answered Ronaldo Araújo Alves 1,954 -
2
votes1
answer108
viewsA: How to reflect on overloaded operators in C#?
As informed in this forum: Invoking Operators by Reflection If you set your own operators, you can utilize them using Reflection(...). However, with primitive types (such as Int32) this is not…
-
1
votes3
answers3047
viewsA: Accessing variable in another class comes null - C# Visual Studio 2015
In Form1, on the line Form2 varivavel2 = new Form2(); you are generating a new instance of Form2, and consequently the variable idselecionada has not yet been set. An alternative is to create a…
-
2
votes1
answer190
viewsA: Use DISTINCT and SUM in the same Query
Tried to remove the table produtos_pedidos of join and using it in a filter with EXISTS? SELECT SUM(a.valor + a.frete) FROM pedidos a, cadastro b WHERE a.status = '2' AND a.data >= '2019-03-29'…
mysqlanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers1353
viewsA: How to change a table to enter a foreign key field?
ALTER TABLE cl_users ADD CONSTRAINT fk_user_status FOREIGN KEY (user_status) REFERENCES cl_users_status(id);
-
1
votes2
answers327
viewsA: Receive List in View. Asp.Net Mvc
The Html.Helper for dropdownlist is: MvcHtmlString Html.DropDownList(string name, IEnumerable<SelectLestItem> selectList, string optionLabel, object htmlAttributes) and the guy in the Viewbag…
-
2
votes1
answer111
viewsA: Savechanges is truncating the decimal value
What’s going on? Entity Framework by default handles decimal with precision 2. How to solve public class EFDbContext : DbContext { protected override void…
-
1
votes2
answers106
viewsA: How to set the first position of the list in Javascript?
To select the SECOND item from the list (since the first is "-"), use: $('#idUJ option:eq(1)').prop('selected', true);
javascriptanswered Ronaldo Araújo Alves 1,954 -
1
votes2
answers445
viewsA: How do I clear a list in Javascript?
Try this: $('#idUJ') .find('option') .remove() .end() .append('<option value="">-</option>'); EDIT Or a cleaner way, suggested by @Sam in the comments: $('#idUJ').html('<option…
javascriptanswered Ronaldo Araújo Alves 1,954 -
1
votes1
answer81
viewsA: Return PHP categories/subcategories records
The query below returns products that are of category 1 or whose products are of a daughter category (1 level) of category 1. SELECT * FROM produto p left JOIN produto_categoria cat ON cat.id =…
-
1
votes2
answers52
viewsA: Does SQL Educational SERVER have fewer resources?
Yes, Sql Server Express has fewer features. The Express version is focused on small-scale applications, the Standard in intermediate applications, and the Enterprise in more robust applications. I…
-
9
votes3
answers601
viewsA: Is a Switch within an Else possible?
Citing the English stackoverflow response -> https://stackoverflow.com/a/2697105/10577440 The switch works by comparing what is in the switch() with what is in each case: switch (valor) { case 1:…
-
0
votes1
answer65
viewsA: Program that makes the entire table between two numbers I type
Failed to increase the value of n1 at the end of the tables. And you’ll need to reset the contador when starting the next number tab.
portugolanswered Ronaldo Araújo Alves 1,954 -
-1
votes1
answer51
viewsA: SQL Select max is not working well
The MAX() takes the higher value. If you want the sum, you must use the SUM()
sqlanswered Ronaldo Araújo Alves 1,954 -
3
votes1
answer347
viewsA: Compare string ignoring uppercase/lowercase letters C#
firstString.Equals(secondString, StringComparison.OrdinalIgnoreCase)
c#answered Ronaldo Araújo Alves 1,954 -
2
votes2
answers64
viewsA: Index('+') works but Index('*') is not working?
Summary: There is a logic problem. The ideal is to do the Substring using the number index, not the operator’s. Why it works on one and not on the other? In the code input.Substring(plusIndex,…
-
1
votes4
answers52
viewsA: Is my char checking logic wrong?
To STOP the loop, use the command break. The continue actually skips to the next loop item. There is a logic error in the code below: if (line.charAt(i) != ' ' || line.charAt(i) != '=') Note that…
javaanswered Ronaldo Araújo Alves 1,954 -
4
votes1
answer28
viewsA: error correction
On line 9 left to close quotes onchange="change_myselect(this.value)> onchange="change_myselect(this.value)">
-
9
votes3
answers1472
viewsA: How does an SQL Injection happen?
How an SQL Injection Happens? The malicious user puts SQL codes in the value of the variable and these codes are executed by the database. Example: Given the code: SqlCommand comm = new…
-
0
votes2
answers198
viewsA: Conditional help in SQL WHERE
Tried to use the filter this way? AND (SD1010.D1_TES <> ' ' OR SF4010.F4_TEXTO NOT LIKE '%*%')
-
3
votes1
answer54
viewsA: Is there a Java method equivalent to C#’s Padright()?
You can use Stringutils, StringUtils.rightPad(minhaString, 10)…
javaanswered Ronaldo Araújo Alves 1,954