Posts by Pedro Gaspar • 3,289 points
96 posts
-
1
votes1
answer134
viewsA: Select from column B if field selected in column A is null
Do so: select COALESCE(DEP.DATAENTRADA, DEP.DATANASCIMENTO) as UltimoDependente from DEPENDENTES DEP join FUNCIONARIOS FUNC on FUNC.FILIAL = DEP.FILIAL and FUNC.MATRICULA = DEP.MATRICULA and…
-
1
votes1
answer15108
viewsA: How to declare a variable in . BAT ("shell")?
The way you did it is already correct to use the variable in a batch script. The command set is used to assign a value to a variable and the command set /p allows Voce to specify a text that will be…
-
0
votes1
answer554
viewsA: How to Select the second line of a textbox text and move it to the first line
The control TextBox owns the property Lines, which returns an array of String with each line of text contained in the control. In addition the control also exposes the methods…
vb.netanswered Pedro Gaspar 3,289 -
1
votes1
answer115
viewsA: Undefined object reference for an object instance. Array
You declared the variable meshCube but did not load the variable with any object, so it gives the error NullPointerException while trying to use it: mesh meshCube; // [...] // erro nessa linha ↓…
-
1
votes1
answer437
viewsA: Taking information from a JSON and saving it to SQL Server using Javascript
In this case, as in most cases, Javascript is running on client side, in the browser of the user accessing your website, more specifically. To save data to SQL Server you would need to have some…
-
0
votes2
answers107
viewsA: I have a password in excel and want to change it in vba
From the research I did it seems that the only way to change the password of a spreadsheet is to save it with the method Workbook.SaveAs(): ' Usando o parâmetro 'Password' o arquivo só poderá ser…
-
2
votes1
answer179
viewsA: Create dynamic table header
You can do it like this: function createDynamicHeader(columns) { var table = document.querySelector('#table_teste'); // Cria um elemento <thead> vazio e o adiciona à tabela: var header =…
-
0
votes1
answer51
viewsA: How can I exchange the part ( "*.jpg", "*.mp4", "*.doc") for a variable?
I didn’t quite understand what you meant by: [...] change the part "*.jpg", "*.mp4", "*.doc" by a variable [...] but, I understand that you want to list certain file types from a specific path,…
vb.netanswered Pedro Gaspar 3,289 -
2
votes1
answer66
viewsA: Select random ID between 2 and 4
You can try to do it this way: SELECT descricao FROM TABLE WHERE ID = FLOOR(RAND() * 3 + 2) LIMIT 1; The function RAND() will return a random floating point number between 0 and 1, ie a decimal…
-
3
votes1
answer240
viewsA: Query joining two tables and filling in fields conditionally
If your SQL Server version is prior to 2012, you can use the expression CASE to solve your problem: SELECT fo.Comunidade, NomeGestor = CASE fu.Cargo WHEN 'Gestor' THEN fu.Nome ELSE NULL END,…
-
0
votes1
answer80
viewsA: Class reference affecting structure
Microsoft Docs: In C# there are two types of values, the "reference types" (Reference types) and the "types of value" (value types). Reference type variables store references to their data…
c#answered Pedro Gaspar 3,289 -
1
votes1
answer456
viewsA: VB.NET - How to sort a Datagridview by color
You can create a column Unbound on your grid and call it "Index", for example, and you would assign numbers in the order you want the colors to appear: Index = 1 -> Grey lines; Index = 2 ->…
-
0
votes2
answers203
viewsA: Generic function js
You can use parameters in the function, this way: function calcular(valor, quantidade, quantidade_devolvida) { var var_quant = 0; if (quantidade_devolvida <= quantidade) { var_quant = valor *…
-
3
votes1
answer868
viewsA: Error 400 when sending request to Esocial (C#)
Cristiano, although he suggested in the comments that you create a reference to the service of eSocial, through the service WSDL, and use the generated class that inherits…
-
4
votes1
answer2112
viewsQ: Communicationexception: Error in client making HTTP (HTTP.SYS) request to third party Webservice
I’m developing for the eSocial for more than a year now, and, I am finding the following error in some customers, when trying to send to the service: System.ServiceModel.Communicationexception:…
-
3
votes2
answers926
viewsA: How to reference the webservices of eSocial by Visual Studio?
Ewerton, the easiest way is for you to access the URL in the browser: https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/enviarloteeventos/WsEnviarLoteEventos.svc?singleWsdl…
-
1
votes3
answers901
viewsA: Webservice REINF Upload - Remote server returned an error: (500) Internal Server Error
Are you using the evtInfoContribuinte (R-1000) in layout version "v1_02_00", but the restricted production environment of EFD-Reinf is already in the version 1.3.02: EFD-REINF Restricted Production…
efd-reinfanswered Pedro Gaspar 3,289 -
1
votes2
answers739
viewsA: C# EFD-REINF 1.03.02 - Invalid event signature. Invalid XML document Digital signature
Some basic tips that should be followed to successfully subscribe: You must use only the event XML to generate the signature, and then the signed event XML is embedded in the batch XML. Batch XML…
-
1
votes1
answer987
viewsA: Reinf - Event error R-5011
After the messages we exchanged in the comments, I did a search here and saw that actually this event R-5011 ("Background information and consolidated taxes by calculation period", by name…
-
0
votes1
answer284
viewsA: How to get the listbox to be ordered increasingly?
Even if you have converted the text to the type Double, before adding the value to the ListBox: lstRoll.Items.Add(Convert.ToDouble(tbNumero.Text)); the classification in control ListBox is always…
-
1
votes2
answers421
viewsA: My C# software with SQLEXPRESS Localdb database does not open on another PC, even installing all dependencies
Repair the path of your Localdb file: AttachDbFilename=C:\Corujasoft\LocalDB\dbMDD.mdf. When you run the program on your computer, the path C:\Corujasoft\LocalDB is valid, but on another computer it…
-
3
votes2
answers211
viewsA: Difference in cast using "as" and "type cast"
When you cast with the operator (), if conversion fails an exception of type will be returned InvalidCastException. Already when the keyword as is used, if the conversion fails the result will be…
-
1
votes1
answer800
viewsA: The submitted document is not a valid eSocial xml
See a correct XML from S-1000 (Information from the Employer) to the eSocial: <?xml version="1.0" encoding="utf-8"?> <eSocial…
-
1
votes1
answer146
viewsA: Select does not return broken value
According to the documentation: / (Division) (Transact-SQL) https://docs.microsoft.com/en-us/sql/t-sql/language-elements/divide-transact-sql the division return type will be the highest precedence…
-
3
votes1
answer115
viewsA: Instantiate method in Instantiated Form
Lucas, when you instantiate an object like Form, it will only have the generic methods and properties that are already present in the type Form. In this case, this method is present in the . NET…
-
0
votes1
answer1981
viewsA: Problem for sending SPED-REINF c#
Are you reporting <tpAmb>1</tpAmb> in XML, but, the type of environment for the restricted production environment (testing environment) shall be 2. The type of environment 1 should only…
-
1
votes2
answers3333
viewsA: XML signing error for EFD-Reinf
Sergio, from what I understand you are using the full XML, Batch + Event, to generate the signature: <Reinf xmlns="http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v1_03_00">…
-
1
votes3
answers167
viewsA: Doubt about C pointers
The operator * when used in the declaration of a variable, indicates that that variable is a pointer: // Numa arquitetura 32-bit, sizeof(ptrToShort) trará como resultado 4, // embora o tipo short…
-
2
votes1
answer160
viewsA: Access 64-bit key in Windows Registry through 32-bit application
On the question you said: If this option is ticada my code does not work on 64 bit system, however if I disable my application does not work on 32 bit machine. In fact, if the value of the field…
-
3
votes1
answer1325
viewsA: digital signature in xml files for E-social
I don’t know PHP, and had never seen the library Xmlseclibs of Robrichards, but, I’m also developing for eSocial (.NET) and know something of the procedure of how to sign events and how to…
-
0
votes1
answer106
viewsA: Generate scale of two people for certain days
I saw that this method you are using to "shuffle" the array, is not very indicated, see this post from the English OS: https://stackoverflow.com/a/18650169/8133067 [community Edit: This Answer is…
javascriptanswered Pedro Gaspar 3,289 -
2
votes2
answers462
viewsA: How to read a value from a Registry key
I tried to use the same code and also returned no value, although the key exists in Registry windows. I then tried this way: Dim regKey = My.Computer.Registry.LocalMachine.OpenSubKey(…
-
0
votes1
answer689
viewsA: The reported Event was not recognized by the system
This error is occurring when submitting the event S-2220 (Monitoring Occupational Health), because this event is not yet available, neither in the Restricted Production environment (tests) nor in…
-
1
votes2
answers96
viewsA: Correct code to select and compare
You can do it like this: SELECT a.* FROM 'Tabela A' AS a WHERE NOT EXISTS (SELECT `b.ID` FROM 'Tabela B' AS b WHERE b.B1 = a.A1 AND b.B2 = a.A2 AND b.B3 = a.A3); You make a sub-query that selects…
-
0
votes1
answer55
viewsA: Search table field with query result from a different table?
You could do something like this, to return all the fields you want in a single query: SELECT `r.from`, `r.to`, COUNT(r.*) AS num_clicks , mf.xml AS xmlFrom, mt.xml AS xmlTo FROM moeda_rank AS r…
-
1
votes2
answers322
viewsA: Find lines of the last 24 hours that repeat the most (Mysql)
You can do something like this: SELECT `from`, `to`, COUNT(*) AS num_clicks FROM my_rank WHERE my_rank_data >= NOW() - INTERVAL 1 DAY GROUP BY `from`, `to` ORDER BY num_clicks DESC To use an…
-
3
votes1
answer1720
viewsA: EFD-Reinf: Invalid signature - Failed to verify XML document signature (using C#)
Muriel, I’ve been through this and today I can successfully sign the events. I am working with eSocial, but the code is basically the same and I even tested the sending of an R-1000 in the…
-
3
votes1
answer989
viewsA: REINF - Invalid Signature
James, a difference between eSocial and EFD-Reinf, until the last time I tested Reinf (I’m more focused on eSocial development) was that in Reinf it was necessary to inform "#Iddoevento" in the…
-
0
votes2
answers897
viewsA: Keystore loading all certificates
user101666, I am also working with eSocial, but I am developing in C#/VB.NET. No . NET there is a ready method that displays the dialog for the user to choose the certificate desired:…
-
0
votes2
answers3518
viewsA: https communication error with Webservice
Glauco, your question is identical to Gabriel Rech’s question: Communication problems with the government-provided web service So I’m going to replicate here the same answer that I wrote there to…
-
1
votes1
answer1632
viewsA: Communication problems with the government-provided web service
Gabriel, I believe you were unable to access the service because the URL you are using is incorrect. When you add the parameter ?wsdl at the end of the service URL, you are requesting the WSDL of…
-
1
votes2
answers4348
viewsA: e-social. Invalid event subscription
Jean already listed most of the problems that normally cause this invalid signature error, but, as it is a very common problem, I will replicate here the answer I gave in other posts, which adds…
esocialanswered Pedro Gaspar 3,289 -
3
votes1
answer1662
viewsA: Esocial - Error signing XML
Rodrigo, in eSocial the signature URI element should be empty, you should not inform the event ID. Also, avoid creating signature tags in hand, Instead, try doing it this way:…
-
2
votes2
answers4027
viewsA: Problem communicating with eSocial webservice
Thank you for the reference to my examples page, Leo! I also created a long time ago a page with tips on how to access the eSocial service, including some of the ones you posted in your question and…
-
1
votes2
answers999
viewsA: Problem with eSocial digital signature - Invalid signature
Mayara, which XML snippet did you use to generate the signature? You should only sign the event XML, not the batch XML, so you should only sign the snippet that starts with the second tag 'eSocial'…
-
1
votes1
answer3208
viewsA: Problem with digital signature SHA-256
Cristian, by your comment it seems to me that you have already solved the specific problem of your original question, but, just remembering that, to create a valid batch for eSocial: The XML of the…