Posts by Rovann Linhalis • 14,881 points
567 posts
-
0
votes1
answer97
viewsA: Group employees by company in query
you don’t need Union in this case: select distinct e.cnpj, e.nome_completo as empresa, coalesce(f.nome_completo,'X') as funcionario from empresa e left outer join funcionario f on f.cnpj = e.cnpj…
-
1
votes1
answer1065
viewsA: Postgresql function with update returns error when upgrading 2 columns
try to do so: SELECT teste('DJUNU'::varchar,1.0::numeric,2.0::numeric) the error that is giving, is that sgdb is not finding a function with that name and parameters…
postgresqlanswered Rovann Linhalis 14,881 -
1
votes1
answer46
viewsA: Where is the error?
Try to do so: $insert = $this->db->prepare("INSERT INTO $this->table (`filename`,`src`,`hash`,`time`) VALUES (:filename, :src, :hash, :time)"); $insert->bindValue(':filename', $filename,…
-
2
votes1
answer505
viewsA: Browse answer tags from a C#site
You will need the HtmlAgilityPack which can be added as a reference in your project by Nuget: Once that’s done, we follow the same logic as Webbrowser, only changing a few particularities of the…
-
0
votes1
answer623
viewsA: System.Nullreferenceexception: Undefined object reference for an instance of an object
You are not assigning the connection to command, try to do so: string sql = @"INSERT Into Usuarios (IdUsuario, Usuario, Senha, Nome, Chave, DtNasc, Fone, Email, OAB, Endereco, Bairro, CEP,…
-
1
votes1
answer254
viewsA: What does ns3 and ns4 mean in an XML file?
is only one Namespace, which in the case of your example file, was placed only nsX believe that inadequately. View documentation: https://www.w3schools.com/xml/xml_namespaces.asp…
xmlanswered Rovann Linhalis 14,881 -
1
votes1
answer314
viewsA: Get Google query Json with Webbrowser C#
We all know that the result of webbrowser will be an HTML, so let’s go through the html getting the elements that are needed, the Divs, in the case of google, that have class 'g' indicating that it…
-
0
votes1
answer22
viewsA: Search for information not directly related in the Database
I believe it’s just a simple select with joins: Select e.id_livro, a.nome_autor, a.sobrenome_autor, l.titulo_livro, coalesce(d.nome_editora,'Não Publicado') as nome_editora from escrito e inner join…
-
1
votes1
answer45
viewsA: Architecture Database
Thinking of a very simple scenario, would do in only one table: Mensagens id | data | remetente | destinatário | mensagem | lida 1 01/01/2017 1 2 Teste false 2 01/01/2017 1 3 Teste true 3 01/01/2017…
databaseanswered Rovann Linhalis 14,881 -
2
votes2
answers75
viewsA: Is it possible to do an Update this way?
Disregarding the question that the column would not be necessary codigoempresa in the printer register, since you already have all the history in the other table: For the multi-line problem, you can…
-
1
votes2
answers282
viewsA: Sum the random data
I think it should be like this: Random rnd = new Random(); int dado6lado; private void button1_Click(object sender, EventArgs e) { int d6 = Convert.ToInt32(qtdD6.Text); int[] dados = new int[d6];…
-
1
votes2
answers1404
viewsA: How to give permissions to user groups in Postgresql?
Create the group access_site: CREATE ROLE acesso_site NOINHERIT LOGIN PASSWORD '1'; Sets the permissions to it: GRANT SELECT ON public.estoque TO acesso_site; GRANT INSERT ON public.estoque TO…
-
1
votes1
answer272
viewsA: Error 1452 Mysql
in its second line of historical Insert, already has an error: ('2015010102', '2', '2', '122135', '2015', '75', '7'), history table has a foreign key where, COD_DISC,COD_TURMA,COD_PROF,ano must…
-
3
votes3
answers76
viewsA: How to do sub-consultation with Pdo
Just give a join with the user table: SELECT e.* FROM usuarios_emblemas e inner join usuarios u on u.id = e.usuario and not u.banido GROUP BY e.usuario ORDER BY count(e.usuario) DESC LIMIT 3…
-
2
votes3
answers4669
viewsA: Consuming Web Service with Login and Password
I believe you have to wear one HttpWebRequest: public static string HttpPost(string url, string postData, string token) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); byte[] data…
-
2
votes3
answers186
viewsA: Crossing of Tables with Multiple Coalesce
see if it solves your problem: SELECT DISTINCT Coalesce(A.ano_pcs_novo,D.ano_pcs_novo) as ano_pcs_novo, Coalesce(A.nro_pcs_novo,D.nro_pcs_novo) as nro_pcs_novo, A.pcs_antigo, B.assunto, A.outras_A,…
sql-serveranswered Rovann Linhalis 14,881 -
3
votes2
answers2537
viewsA: How to Read and Convert . xsd Extension File to a C#Class
I used the https://xsd2code.codeplex.com/ an addon pro visual studio. Once installed, just right click on the xsd (inside the Solution explorer) and then on Run Xsd2Code Generation.…
-
1
votes1
answer126
viewsA: View Products Subcategory
If a sub-category belongs to a category, it is not necessary to have one fk for category and one for sub-category in the product register, it is sufficient to have the sub-category. The same applies…
phpanswered Rovann Linhalis 14,881 -
2
votes1
answer964
viewsA: Data of a Datagridview configured in another Form
It doesn’t work if you create another instance of Form1 within the Form2. You would have to pass the instance that is open from Form1 or insert directly into it. The simplest thing is: By clicking…
c#answered Rovann Linhalis 14,881 -
0
votes1
answer106
viewsA: Pull the last information from a table
Some order is necessary to follow, in that code I used the date, and if they are equal follows the ID. With subselect the previous Km_column is generated, you can use it as you like. SELECT ID,…
-
0
votes3
answers378
viewsA: Doubt SQL query d
I imagine you want the average number of open calls per year/month, so that would be: SELECT DATEPART(YEAR, S.SolData) Ano, DATEPART(month, S.SolData) Mes, Count(S.SolID) / dbo.dias_uteis(…
-
0
votes2
answers798
viewsA: Sum with Internet Oracle
just add the column of table c in Select and Group by SELECT c.NOME_PRODUTO, c.COD_PRODUTO, SUM(b.QTD_SALDO) AS SALDO FROM ESTOQUE_1 b INNER JOIN ESTOQUE_2 c ON b.COD_PRODUTO = c.COD_PRODUTO WHERE…
-
5
votes3
answers50
viewsA: Returning information recorded in the bank
Yes you will, you have to be in a transaction for that, of course. Even if you cannot execute the rollback, the commit will also not be executed and is only in commit that the information is saved.…
-
0
votes2
answers154
viewsA: How does the server know that the index is the main page?
Yes, it is standard. Depending on your web server, you can set which document is the default in the settings, or in Asp.net for example, set this by the web.config file as well
-
2
votes2
answers1297
viewsA: Find the name and number of doctors who have appointments with all patients
You need to select all the medical ids present in the consultation table, and make a Join to search the respective doctor’s data, see the code below: SELECT distinct c.id_medico, m.nome as…
postgresqlanswered Rovann Linhalis 14,881 -
1
votes1
answer402
viewsA: Mysql - Update column with Brazilian date value
The bars are missing in their shape update cadastros_dados set data_nascimento = STR_TO_DATE(nascimento,'%d/%m/%Y') job documentation:…
-
0
votes1
answer721
viewsA: Store data set values in ASP.NET variables
You are scrolling through each Datatable row within the foreach, only having to inform the column. You also cannot have return, return1 and return2 to get the results. Imagine that you will have 50…
-
1
votes2
answers61
viewsA: Make a SQL language design that returns the number of clients who have no business done
If your function should only return an integer, you cannot have other columns, only Count(*). Apart from this case stack when it’s a mess. The function code would look like this:d CREATE FUNCTION…
-
0
votes4
answers45
viewsA: How to pass a text from the database to display it as a link on a website
For the displayed text to be the contents of column 1, and the link, the contents of column 3: echo("<a href='".$row_artigos[3]."'>".$row_artigos[1]."</a>"); For text and link to be in…
-
0
votes1
answer458
viewsA: Same page, different content?
It’s not the answer to your question, but it’s to help solve the problem with the modeling I told you about: From what I understand, you only need 2 or 3 tables. Making with 2: Table of Categories:…
-
3
votes1
answer117
viewsA: Perform sub-query with data from a first
The excerpt QUANTIDADE = (subselect) is wrong. And you just assign a name to the table in which you are giving the SELECT. For your need, the code would look like this: SELECT DISTINCT a.ID AS…
-
2
votes1
answer19
viewsA: Change Toolstripstatus value while typing in Richtextbox
You will need to: 1-Richtextbox: richTextBox1 1-Toolstripstatuslabel: toolStripStatusLabel1 1-Timer: timer1, with an interval of 300ms Use the Textchanged event from richTextBox1: private void…
-
2
votes1
answer1694
viewsA: The 'Oraoledb.Oracle' Provider is not Registered on the local machine
You need to register the OLEDB driver: 1 - Check the folder containing the file OraOLEDB11.dll. ('oracle product 11.2.0 client_64 BIN') 2 - Open cmd as administrator 3 - Navigate to the folder…
-
6
votes1
answer151
viewsA: What is the origin of green in hacker culture?
In the 1980s, green phosphorus monitors were used, and often featured 'ghosts' on the screen. In addition to inspiring this hacking look, it also inspired that look of Matrix. see more in:…
linuxanswered Rovann Linhalis 14,881 -
1
votes2
answers117
viewsA: Return records that total desired value
For what I went through the chat, and using the date to sort the records (yes, if you need the moment you had the balance 0, you need to have the records of the moments in which they happened) I…
-
3
votes1
answer186
viewsA: Enable a button after entering password
Understanding that your project is winform when you say "I have a form", use the Textchanged event from Textbox: private void textBox1_TextChanged(object sender, EventArgs e) { ButtonDelete.Enable =…
c#answered Rovann Linhalis 14,881 -
0
votes2
answers150
viewsA: Use one if with two selects
You can use the function IFFNULL or COALESCE: SELECT users.*, COALESCE( (SELECT tb1.image FROM ce_users_images tb1 WHERE tb1.iduser = users.id_user LIMIT 1),'Nenhuma imagem informada') AS tmp1 FROM…
-
4
votes2
answers2375
viewsA: Sum the total value of two columns, subtract, and return even if negative Mysql
What actually happens is, when there’s a day when there was no expense, or there was no revenue, the column is returned as null, when performing an operation with the column null the result will be…
mysqlanswered Rovann Linhalis 14,881 -
3
votes1
answer117
viewsA: How do I output my array’s Indice in C?
if you’re giving the printf within the for, he is typing several times the message. what you need to do is, first find out which index has the highest value, and then the for make the impression…
-
1
votes2
answers170
viewsA: Are there limits to the use of logical operators in the Mysql query?
There are no operator limits, but they directly affect the performance of the query, including the order in which they are placed. Your query is valid, but may not bring you the desired result by…
-
4
votes2
answers6147
viewsA: Concatenate columns into a single Postgresql row
Use the function array_agg(expression): Select array_agg(codigo) from tabela A In the link you can see the postgresql documentation for more information.…
-
1
votes1
answer229
viewsA: Usability tutorial with transparency c#
As I had commented, I was developing a form that meets your need. Follow the commented code: using System; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Testes {…
-
2
votes1
answer42
viewsA: Problem leaving form as top c#
Put your Main Form as MdiContainer, and define the MdiParent from your secondary form, as your main form. Example: private void btnCalculadora_Click(object sender, EventArgs e) { Calculadora = new…
-
1
votes1
answer404
viewsA: Clear Panel from a Usercontrol
You’ll have to catch the event from Button that is inside the userControl. in the userControl code, enter a property that returns the Button as public. So: public Button BotaoLimpar {get{ return…
-
2
votes3
answers43
viewsA: Prohibit lines from being exactly the same in the database
As stated in the comments, the correct situation is to use a single index. Create a UNIQUE INDEX in postgresql: CREATE UNIQUE INDEX tabela_unique_idx ON public.tabela USING btree ("col1", "col2",…
-
1
votes1
answer79
viewsA: A list of a guy can’t pass as a list of his 'higher' type?
Covariance is the conversion of an object of the most specific type Banner in a more generic type ElementoOrdenavel. Operators may only be used in parameters of interfaces or delegates generic. It…
-
2
votes2
answers558
viewsA: List two distinct tables and filter by Mysql data - PHP
If all columns are of the same type, just use the UNION: SELECT FORMAT(r.valor_receita,2,'de_DE') AS valor_receita, DATE_FORMAT(r.data_vencimento, '%d/%m/%Y') AS data_vencimento, r.recebido,…
-
1
votes1
answer62
viewsA: How to correctly apply String.Format
No entering the client/server side issue, your problem is just being the signal , where it should be . Behold: txtBonMaster.Text = objBonusVenda.BonMaster.ToString(String.Format("{0:0.0}", value1));…
c#answered Rovann Linhalis 14,881 -
3
votes1
answer1636
viewsA: How to make a query per day, week, month period in Mysql
There are many ways to do this, see the Mysql documentation for Dates:MYSQL Date and Time Functions. Examples: Yesterday: Select * minhaTabela where Date(Data) = DATE_SUB(CURDATE(),INTERVAL 1 DAY);…
-
0
votes3
answers55
viewsA: Automatic punctuation in the lines of a Multiline Textbox
If it is at runtime, you will have to search for javascript, then I can’t help you much, however, if it is only at the time of insert, you can execute the command replace, changing the line break…