Posts by Ronaldo Araújo Alves • 1,954 points
85 posts
-
1
votes1
answer224
viewsA: Show file in Solution explorer
Tools > Options > Projects and Solutions Check item "Track Active Item in Solution Explorer"…
visual-studioanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers118
viewsA: Error inserting formula into a cell in Excel via C#? Worksheet?
newWorksheet.Cells[3, 1] = "=CONT.SE(Sheet 1! B2:B7;'Blocked"; Missing close parentheses in the formula =CONT.SE().
-
1
votes1
answer45
viewsA: Way to get all results of SQL Command query
The ExecuteScalar takes only the first column of the first row. To list the records, use the ExecuteReader(). For example: SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) {…
sql-serveranswered Ronaldo Araújo Alves 1,954 -
2
votes1
answer769
viewsA: Check if a certain value already exists in an SQL Server table
Solution: As stated by Ricardo Pontual in the comments, it is necessary to quote 123 Explanation When comparing two different types, an implicit conversion is made. As said in documentation: When an…
sql-serveranswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers46
viewsA: mysql query that groups the distances travelled each day
whereas this odometer is the distance, you can add this and group by driver: SELECT DATE(l.dateGenerated) AS Day, d.name AS Conductor, ROUND((sum(l.odometer)/1000),3) AS Route from location l left…
-
1
votes1
answer51
viewsA: How do I bring the same numbers from other tables?
To see which Cpfs repeat themselves: Select t.cpf from tabelaComCampoCAND_SQ t inner join tabelaComCampoCANDPL_SQ t2 on t1.cpf = t2.cpf But if the need is just a validation before registration…
-
0
votes1
answer308
viewsA: Inner Join php to search in two tables
products.name = user name.name Your John is picking up records whose user name is equal to the product name. In the join, use the fields that are related, which I don’t know what they are because I…
-
0
votes2
answers118
viewsA: Basic SQL (Join and Where)
Your select is not ordering the field valor, so just show the name: select name from Authors Inner Join Books_authors as La On La.id_author= Authors.Cod Inner Join Books as Liv On La.isbn = Liv.isbn…
-
0
votes2
answers46
viewsA: Return of a Checkbox to Javascript
A way for you to check if the checkbox is checked: $('#aprovado').prop('checked');
checkboxanswered Ronaldo Araújo Alves 1,954 -
3
votes1
answer82
viewsA: Make if in an HTML tag to add or not attribute "checked"
If I understand correctly, the Html.Raw() can help you: @( suaVariavel == "true" ? Html.Raw("checked"): Html.Raw(""))
-
3
votes1
answer175
viewsA: Is there a command in sql server that returns the number of records in a table?
I’m considering you have a table called Cliente, and in this table has a field called DataNasc. The code below returns a list of all ages and the amount of records at that age: declare @hoje as…
-
1
votes1
answer110
viewsA: Query with 3 conditions AND does not work the last condition
We had to adjust the join. You are giving select in two tables without "linking" the same. Enter a condition viaturas.CampoRelacionado = despacho_ocorrencias.CampoRelacionado to avoid a select of…
-
2
votes1
answer36
viewsA: Difference between echo with Brackets and without Brackets
Response and example taken of this link: 1- echo with Curly Brackets allows you to use the variable inside strings to separate the variable value of the text around it. $verb = 'add'; echo "Present…
phpanswered Ronaldo Araújo Alves 1,954 -
0
votes1
answer59
viewsA: Different ways to do a query that performs an SQL merge
This is a simplified way of making joins by not explicitly using JOIN, LEFT ON and type instructions? I would not say a "simplified" way, I would say an "alternative" way to do INNER Join, because…
-
1
votes1
answer58
viewsA: Viewbag error: does not contain a definition for field name
The ViewBag.LogAlteracao that you’re going through is a list. And the Acao is a property of a LogAlteracao. Place inside a loop, access the ViewBag.LogAlteracao[i].Acao and be happy :)…
c#answered Ronaldo Araújo Alves 1,954 -
1
votes1
answer85
viewsA: creation of a composite KP
Yes, it is possible. You need to remove the current PK Constraint and add a new PK. alter table produto drop CONSTRAINT <nome_constraint> alter table produto add primary key (id_cliente,…
-
0
votes4
answers1546
viewsA: Take specific value from a JSON or XML
1- You are using the Dados as an object of deserialization: Dados result = JsonConvert.DeserializeObject<Dados>(json); But the object to which the string json refers is the DadosMenu 2- You…
-
2
votes1
answer43
viewsA: What is the Difference between Rebin and Databind?
Databind is a way to "tie" the object (Ex: Datagrid) to a data source (Ex: a list of a given object). Rebind in fact it is not a method or something similar, it is just a nomenclature, a "nickname"…
c#answered Ronaldo Araújo Alves 1,954 -
2
votes1
answer1533
viewsA: How to convert a VARCHAR(30) FIELD WITH SPECIAL CHARACTERS TO NUMBER?
Whereas the decimal separators in the field are in the same culture as you are working on, this command converts varchar to numeric select cast(campo1 as float) * cast(campo2 as float) as vlr_taxa…
-
4
votes1
answer280
viewsA: Where x whereRaw What’s the difference?
The whereRaw() is a function of the Laravel Builder query to put the input as it is in the clause where. It’s basically a function where() whose arguments will not be processed before they are…
-
1
votes1
answer42
viewsA: Repetitive array
There is a nested loop: the abrircatalogo() is inside a loop, but internally executes another loop. Remove the abrircatalogo() from within the for…
javaanswered Ronaldo Araújo Alves 1,954 -
0
votes3
answers240
viewsA: View does not appear in query - Sql Server
Edit -> Intellisense -> Refresh Local Cache Or the shortcut: CTRL + SHIFT + R
-
0
votes2
answers31
viewsA: Mysql search with input error
Are you trying to get the input name "search name": $pesquisaNome = $_POST['pesquisar_nome']; The name you are passing is "client name"
-
2
votes2
answers803
viewsA: Mysql query with LIKE
WHERE user_nome LIKE ' -- <---- o erro está aqui %Juscelino%'
mysqlanswered Ronaldo Araújo Alves 1,954 -
3
votes3
answers91
viewsA: Sort by SQL numbering
It doesn’t seem like a very nice solution, but I tested it here and apparently it worked. select Id,ReqNorma from TABLE where Norma = 'ISO 9001' ORDER BY CAST( SUBSTRING(ReqNorma, 1, charindex('.',…
sqlanswered Ronaldo Araújo Alves 1,954 -
2
votes1
answer29
viewsA: How to store records in tables when they have Foreign Keys?
When there’s a field Forgeign Key the record can only be created if the value of this field is consistent with the referenced field. Ex: Imagine a table Pedido which has a FK field IdCliente…
-
1
votes2
answers33
viewsA: Hiddenfield value always zero
I believe that the .Text will not get value from an Hidden field. An alternative is to use this column as a Datakey. <asp:GridView DataKeyNames="id" ... In the event you need to use: protected…
-
1
votes2
answers65
viewsA: I’m trying to do a research boot on my view, but tell me it can’t be null
The problem is because the search is null. Just reverse the order. Of x => x.MovieCategory==search || search == null Change to x => search == null || x.MovieCategory==search The reason is that…
-
0
votes3
answers83
viewsA: Add value to my contact for each multiples of 200 without having to create individual variables
Correct me if I’ve got it wrong, but try this: function Conversor(valNum){ var gre = valNum >= 200 ? 4 : 2; var soma = parseInt(valNum / 200) return soma * 4 + valNum * gre; }…
-
0
votes2
answers90
viewsA: I’m not getting C. Please help me!
The mistake you’re making is: segmentation fault (core dumped) This error is caused on this line: scanf("%d",S); Missed the "&": scanf("%d",&S); If you asked the question stating this error,…
canswered Ronaldo Araújo Alves 1,954 -
0
votes1
answer25
viewsA: Help mount select
An alternative is: Select * From TB_PRODUTO WHERE (DT_ENTRADA >= '2019-05-21' AND ST_PRODUTO = 0) OR (DT_ENTRADA < '2019-05-21' AND ST_PRODUTO <> 0)
sqlanswered Ronaldo Araújo Alves 1,954 -
1
votes1
answer73
viewsA: Relationship of two MYSQLI tables
Correct me if I’ve misunderstood the question, but I think you need this: SELECT ii.sku, ii.cod_setor, ia.setor_ini, ia.setor_fim, ia.desc_ambiente, ii.cod_coletor FROM item_inventarios ii inner…
sqlanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers228
viewsA: Can I create a Foreign Key between 3 tables?
It will not be a FK between 3 tables, it will be an independent table (Actors) and two dependent on Actors but independent of each other. The links will be: Actors and MoviesData Actors and…
sqlanswered Ronaldo Araújo Alves 1,954 -
1
votes2
answers114
viewsA: mysqli_connect does not connect
$result_carousel = mysqli_query ($con,$cal_carousel) or mysqli_error($con); I believe you’ve forgotten the die: $result_carousel = mysqli_query ($con,$cal_carousel) or die(mysqli_error($con)); The…
-
2
votes2
answers117
viewsA: Why do you enter if even if it is false?
Within the if you change only the value of indMaior without changing the value of maiorValor. I mean, WHENEVER YOU GET TO THIS if he does if(0 < notas[i]), since there is no value less than or…
-
1
votes3
answers44
viewsA: Return larger field to ID
Try this: SELECT codprod, MAX(nutab) FROM tabela GROUP BY codprod
-
0
votes3
answers113
viewsA: Select two tables
Correct me if I’ve got it wrong: SELECT DISTINCT c.id, c.site, c.cliques_usados, c.cliques, c.localizacao, c.tipo, c.id_user FROM campanha c LEFT JOIN campanha_cliques p on p.id_campanha =…
-
1
votes4
answers197
viewsA: Correct syntax way in object instance
Like most programming, there is no form correct, there is the shape that best fits according to your need. But what is the difference between these two forms cited? First we have to consider that…
-
4
votes1
answer62
viewsA: Consult in 2 table
SELECT (campos) FROM tabela1 t1 -- t1 é um alias, como se fosse um 'apelido', poderia ser qualquer nome INNER JOIN tabela2 t2 on t1.campoReferenciado = t2.campoReferenciado In your case it would be:…
-
1
votes2
answers119
viewsA: How not to update empty fields
Update tabela set coluna = coalesce(valorParametro, coluna) Where IdUsuario = id;
-
0
votes2
answers75
viewsA: Get an item from a referenced list
sbString.Appendline(i); When you add the instance in StringBuilder implicitly you are making a i.ToString() to add the object to StringBuilder, so the class and the namespace appears. An alternative…
-
1
votes1
answer55
viewsA: Change object data that is in a list
TL;DR: If I make a change to the object outside the list, the object inside will also change? Yes Explanation The objects we create are of the Reference Type (read Ref Type vs Value Type), works as…
-
1
votes2
answers73
viewsA: Variable is not receiving value - C#
When doing the division operation int / int, the language rounds down to keep the value as type int. Contador is 49, maximum is > 49. A division of an int by a value greater than it will always…
-
1
votes2
answers2655
viewsA: Beginner : C# recursive function
StackOverflowException occurs when there is a overflow Stack memory, usually caused by over nested functions. In the case on the line return soma / MediaLista(v); you didn’t change the vector at all…
-
1
votes1
answer169
viewsA: Crop a sql server string
This command will take everything that is afterward of the latter / select right(minhaString, charIndex('/', reverse(minhaString) + '_') - 1) This will take everything that is before of the latter /…
sqlanswered Ronaldo Araújo Alves 1,954 -
0
votes2
answers90
viewsA: Problem with database query by date using Line and Entity in C#
Alternative 1: consultas = ctx.Consultas.Where(a => a.Inicio.Date == entrada.Date) .Include(c => c.Cliente).Include(p => p.Procedimento).ToList(); Alternative 2: consultas =…
-
2
votes2
answers64
viewsA: VARIABLE C# HELP
The method URLL() is not static. An alternative is to leave him static. Or keep as you are and leave the variable valueless, and in a given non-Static method you assign using ServerURL =…
c#answered Ronaldo Araújo Alves 1,954 -
1
votes4
answers120
viewsA: Simplification of the jQuery code
An alternative is to make a each() for each input of div or form. In the example assign an id to the form and I used the code below: $('#form1').submit(function(){…
-
1
votes1
answer764
viewsA: How to Select Tables in Different SQL SERVER 2008 and 2012 Databases
As in the mysql response that rLinhares quoted in the comment, just specify the full path of the table: [server]. [database]. [schema]. [table] Example: select * from tabelaBancoAtual t1 inner join…
-
0
votes1
answer100
viewsA: Multiple references to a FK in the same column/row
Relationships of tables can be: - 1-1 Ex: a user table and a customer table, where each customer can have ONE user, and each user can belong to ONE customer only - 1-n Ex: an order table and a…