Posts by Maicon Carraro • 8,881 points
269 posts
-
0
votes3
answers1096
viewsA: Pass Viewbag to _Layout
The @Gypsy should probably know a better solution, but the only thing I thought was to add on own Session, example: var selectList = new SelectList (suaLista, "ID", "Texto");…
-
1
votes1
answer66
viewsA: Transfer value from C# to jQuery
As you have not shown the code, I don’t know exactly how you are doing, but if you want to call a function javascript through the CodeBehind can be done like this: var caminhoMusica = /* seja lá…
-
3
votes3
answers107
viewsA: Doubt with relation of tables
You did not specify if your doubt is in the assembly of SELECT or in the construction of the code PHP, then we’ll go in pieces: SQL (Using INNER JOIN to relate the tables) SELECT…
-
1
votes2
answers481
viewsA: How to increment the txt file name that will be created in php?
If you don’t have a memory control of which number you need, I thought of the following solution: Read all files from a directory. I make a regex to get all numbers in the title. I look for the…
phpanswered Maicon Carraro 8,881 -
3
votes3
answers187
viewsA: Return to condition start when prompted
Although not the best option, one option is the goto. voltaAqui: ... código goto voltaAqui;
canswered Maicon Carraro 8,881 -
25
votes3
answers27676
viewsQ: Differences between Onkeyup, Onkeydown and Onkeypress?
When exactly are they fired? And what are the usage contexts for each one? I ask this because every time I needed to use it I always solved it with onkeyup. Although the doubt is in javascript it…
javascriptasked Maicon Carraro 8,881 -
0
votes2
answers128
viewsA: List the daily records?
I believe your correct SQL is this one: SELECT Requisição.dataRequisicao, Requisição.codRequisicao, Utilizadores.numProcesso, Utilizadores.nomeUtilizador, Turma.Ano, Turma.Turma, Turma.Curso FROM…
-
1
votes2
answers334
viewsA: C: Use two gets() in a row (player names)?
Do not use the get he is not very safe and gives enough trouble with the buffer, a good alternative is the scanf. Example: printf("Nome do Player1: "); scanf("%s", &player); printf("\n");…
canswered Maicon Carraro 8,881 -
5
votes2
answers670
viewsA: How can I make a variable wait for the user to press 1 of 4 buttons?
I believe you put the same onClick in everyone? One output is you compare by id of the component that sends the "clicked", thus: public void cliqueGenerico(View v) { int tentativa; switch…
-
0
votes1
answer41
viewsA: List calls with or without idFunctioned
Change your SQL from SELECT c.*, cli.*, f.idFuncionario, f.* FROM chamada AS c, cliente AS cli, funcionario AS f WHERE c.idCliente = '".$valor->idClienteChamada."' AND cli.idCliente =…
-
2
votes1
answer71
viewsA: Error passing JS array values to simple PHP
Your mistake is in javascript, but one remark before, you are defining the array_produtos twice what would be unnecessary. var array_produtos = Array([1,2,3,4,5,6]); /* aqui */ var i,…
-
4
votes1
answer5100
viewsA: SELECT SUM MYSQL
I don’t know exactly what problem you have with DISTINCT, but it’s supposed to work perfectly like this with a SELECT external: select SUM(t.valor_sap) as total FROM ( select DISTINCT…
mysqlanswered Maicon Carraro 8,881 -
0
votes1
answer39
viewsA: Label Indefinite Graphic with Flot and PHP
In his SELECT there is no column called tipo_conta_nome, then there really will never appear anything with that column. Alter your SELECT to return some column with the name tipo_conta_nome or…
-
1
votes1
answer122
viewsA: append com jquery
When you call Function Pesquisar() the first line is $('.corpoTbl').remove(); Who ends up removing them all <tr class=\"corpoTbl\"> that you added earlier, I believe removing this line will…
-
0
votes1
answer641
viewsA: Pick up object by clicking on a commandLink in the Datatable
Techies, your problem is using the actionListener whereas the correct would be just action. The problem of actionListener is that he executes before the action. Your code would stand:…
-
1
votes2
answers92
viewsA: How to make a method to write to the variable in which it extends?
If you want to use Extension Methods it would be something like that: using System; public static class ExtensionMethods { public static bool toggle(this bool value) { return !value; } } And to use…
c#answered Maicon Carraro 8,881 -
1
votes2
answers140
viewsA: replace javascript
If you want to do this treatment for all elements a, you can use the getElementsByTagName() Example: function myFunction() { var as = document.document.getElementsByTagName('a'); for (var i=0; i…
javascriptanswered Maicon Carraro 8,881 -
1
votes1
answer151
viewsA: Tables with database data
This problem of scroll in the table and keep the header is well famous. First solution jQuery Scrollable. Important, this plugin loads all table at once. Example: jQuery(document).ready(function($)…
-
0
votes1
answer317
viewsA: Exception returned null Java Web
Your problem is you’re not instantiating your object message, do so: @PostConstruct public void init(){ this.message = new Message(); /* isso aqui */ listAllMessage(); listAllCategory();…
-
2
votes1
answer3252
viewsA: C - Concatenate char (Not STRCAT)
Your problem is here strlen(x +1), the correct would be strlen(x) + 1. Staying x[strlen(x)+1] = c; Depending on your code you don’t even need add up 1, example: #include <stdio.h> #include…
canswered Maicon Carraro 8,881 -
2
votes1
answer772
viewsA: "By Onchange" form validation with javascript
Its function is to validate the form as a whole, not individually, so the correct thing would be for you to remove onchange and stay only in the onclickof your button or onsubmit of form. Another…
-
0
votes2
answers602
viewsA: Combobox and database connection
I am adding another answer to not pollute too much my current solution that would be the most correct. Your way out is to create a class I’ll call ComboBoxItem and add the values using it instead of…
-
3
votes3
answers438
viewsA: How to make a standalone script using Global.asa
The problem of using the Global.asa is that it does not guarantee that your script will run every time, if it is not constantly in use the IIS can stop the process after a while then it is not…
-
3
votes2
answers6350
viewsA: View and edit registered data
Based on their SELECT you can see that you use the field email as identifier of each user, then its UPDATE will look a lot like the INSERT and the only detail is WHERE email = $email. if($row >…
-
0
votes2
answers602
viewsA: Combobox and database connection
Based on the comments I believe that your problem is not in the structure but in the way you are recovering the value of combobox, you just own the descrição in the combobox and not the identifier…
-
1
votes1
answer452
viewsA: Search records from one date to another
André, I created an example in Sqlfiddle for you to take a look here. Sqlfiddle Demo In this example, I created an example table tb_exemplo and entered 4 values: Value 1, Date '2015-05-19' Value 2,…
-
5
votes1
answer6281
viewsA: Remove Part String Javascript Informing the End
I made a combination of substring with the indexOf, I get which index the "Endereço: " and we add to this index the number of characters that this text has, in case 10. var str = "texto antes…
javascriptanswered Maicon Carraro 8,881 -
2
votes1
answer96
viewsA: Problem in phrase search function
I don’t quite understand what the point is parada, but your mistake is exactly in this variable in relation to if/else. I did some tests here and the problem happens when you don’t fall into any…
canswered Maicon Carraro 8,881 -
0
votes3
answers1239
viewsA: Code to display the login client data
One of the ways to do that would be: /* lembrando que o correto é você ter `user` únicos, ou seja, sem repetir no banco */ $userLogado = $_SESSION[' nome da variavel que você guardou o usuário '];…
-
1
votes1
answer1195
viewsA: Javascript image exchange checkbox
If you have more than one option to change the same imagem then my recommendation is to use radio instead of checkbox and separate it into groups. The problem of checkbox I think it would be when…
javascriptanswered Maicon Carraro 8,881 -
7
votes1
answer3595
viewsA: Only take the user’s name and surname
Try it like this $partes = explode(' ', $nomeUsuario); $primeiroNome = array_shift($partes); $ultimoNome = array_pop($partes); array_shift - remove and return the first array value. array_pop -…
phpanswered Maicon Carraro 8,881 -
2
votes1
answer28
viewsA: Return tags associated with posts
And if you do something like this SELECT imprensa_posts.slug AS slug, tipo, titulo, data, GROUP_CONCAT(imprensa_tags.slug) AS tag_slugs, GROUP_CONCAT(tag) AS tags FROM imprensa_posts JOIN…
-
1
votes1
answer49
viewsA: Error while clearing a Datagrid
You’ve tried it here: dg.ItemsSource = null; dg.Items.Refresh();
c#answered Maicon Carraro 8,881 -
3
votes2
answers66
viewsA: Problem to mount query
According to the information provided in the comments I believe you want this: SELECT p.categoria, MAX(p.nome) as nome, p.pontos FROM produtos p INNER JOIN ( SELECT categoria, MAX(pontos) as pontos…
-
3
votes4
answers329
viewsA: What’s wrong with my map version for a JS array?
In the first example the function push is not defined because it is exclusive to Array. It is not a global function. In your second example the error is here: forEach(kiko, function(element){ var…
javascriptanswered Maicon Carraro 8,881 -
3
votes1
answer1173
viewsA: Redirect to another page only if the user is authenticated
public void entrar() { try { UsuarioDAO usuarioDAO = new UsuarioDAO(); usuarioLogado = usuarioDAO.autenticar(usuarioLogado.getLogin(), usuarioLogado.getSenha()); if (usuarioLogado == null) {…
-
1
votes1
answer236
viewsA: Freight Table - District Listing
I believe your SQL is something like this: SELECT * FROM bairro as b Left join tabelafrete as t on b.idBairro = t.idDestino and t.idSaida = '".$id."
-
2
votes1
answer26
viewsA: Return of Equal Employee
If you want to add the employee name on the return of the query is not easier to get it on SELECT? I believe that your idFuncionario is on the table Chamada, then: $sql = "SELECT DISTINCT c.*,…
-
1
votes3
answers954
viewsA: How to get the text of the selected item in the listbox?
Your problem is in the Page_Load, because every time a postback is made its method of Page_Load is called and is always recharging your data. To avoid reloading data on PostBack just doing that:…
vb.netanswered Maicon Carraro 8,881 -
0
votes2
answers763
viewsA: Is it possible to compare items from two lists and if there is similarity between items do not display this item in a datatable?
A very ordinary solution would be Iterator<Solicitacoes> iter = list.iterator(); while (iter.hasNext()) { Solicitacoes solicitacao = iter.next(); for(Solicitacoes s : lista){ if…
-
1
votes2
answers222
viewsA: SQL Contar ROWS
I tried to do a trick with the HAVING COUNT, but I don’t know if it will. SELECT (SELECT COUNT([VendasPOS_Linhas].[PRENUMERO]) FROM [MXPETROL_AB].[dbo].[VendasPOS_Linhas] INNER JOIN ( SELECT…
sqlanswered Maicon Carraro 8,881 -
1
votes1
answer147
viewsA: Update tables with the same data in the row
There are two serious problems in its structure by not saving the IDCatg on the table Produtos. When your Category has changed its description it will become outdated in the table Produtos. (Your…
-
4
votes1
answer105
viewsA: Perform a redirect in Constructor
Redirect in the constructor can give some problems due to context besides not being a good practice, one solution is you create a custom attribute for your action and overwrite the method…
-
9
votes4
answers1851
viewsA: Infer class type from a generic
Apparently it is not possible to catch the type of the list at runtime, what to do is to check if she has any objeto inserted and catch the type of it. Example: private Class clazz;…
-
1
votes2
answers1018
viewsA: My js file is not loading
I think I’ve identified your problem, you’re not returning the objAjax in the role of iniciaAjax(), do: function iniciaAjax() { var objAjax = false; if (window.XMLHttpRequest) { objAjax = new…
-
2
votes1
answer361
viewsA: Modifying Values of Multiple Lines
If you want to modify or change values of a table you use the UPDATE and not the INSERT. Example: UPDATE registros SET Envio = '1' WHERE Aviso = @dataFormatada Treat your date instead of…
-
3
votes1
answer1952
viewsA: Read CSV file without needing to save it
You’ve tried it before: StreamReader csvreader = new StreamReader(file.InputStream); while (!csvreader.EndOfStream) { var linha = csvreader.ReadLine(); var valores = linha.Split(';'); // o que você…
-
3
votes1
answer3205
viewsA: Search field in the <select> form
If I understand correctly what you’re looking for is the Chosen, it is a jQuery pro plugin that provides this search option in a select among other varieties, for example creating tags similar to…
-
2
votes1
answer138
viewsA: Doubt to automate javascript function
I changed its function, give a look: function manipulaDiv(checked, idDiv) { if (checked) { document.getElementById(idDiv).style.display = ""; } else { document.getElementById(idDiv).style.display =…
-
2
votes3
answers22753
viewsA: Error in select using mysqli_query
I believe that’s what you need: <table class="table table-bordered"> <tr> <th class="tg-031e" colspan="3"></th> </tr> <tr> <td class="tg-031e"><img…