Posts by Rovann Linhalis • 14,881 points
567 posts
- 
		1 votes1 answer144 viewsA: How to create a track extending an Image in c#You must create a new image, with larger size, and redesign your image from above: using (Image image = Image.FromFile(originalFilePath)) { System.Drawing.Bitmap novaImagem = new… c#answered Rovann Linhalis 14,881
- 
		1 votes1 answer429 viewsA: Matrix Printer Printing with WPF C#Option 1= Assemble a text file, and send it to the printer, copying the file to it. Ex: in the C#: File.Copy("arquivo.txt","\\servidor\lx300"); or File.Copy("arquivo.txt","lpt1"); Option 2= Use a… 
- 
		0 votes1 answer35 viewsA: Query with NOT IN in mysqlI didn’t see any big problems in her query, she just didn’t bring an employee’s name or id, and I removed a parentheses from/John that I believe shouldn’t be there. Check the result: SELECT DISTINCT… queryanswered Rovann Linhalis 14,881
- 
		5 votes3 answers77 viewsA: How do I link three tables?you can do it this way: Select p.id, p.nome, sum(coalesce(e1.quantidade,0)+coalesce(e2.quantidade,0)) as Quantidade from cadastro_produtos p left outer join estoque1 e1 on e1.c_prod = p.id left… sqlanswered Rovann Linhalis 14,881
- 
		1 votes1 answer199 viewsA: Make a textbox visible by selecting a radio buttonYou can use the property AutoPostBack for the page to process changes: AutoPostBack="True" <asp:RadioButton ID="RadioButton1" runat="server" GroupName="pesquisa" AutoPostBack="True" /> Teste… 
- 
		0 votes2 answers1665 viewsA: Limit Inner Join Resultin that case, I think it would fit only a sub-select: SELECT `imovel`.`imvValorImovel`, `imovel`.`imvCodigo`, `imovel`.`broCodigo`, `imovel`.`imvDormitorio`, `imovel`.`imvSuite`,… 
- 
		15 votes3 answers649 viewsA: What is the Target Framework and what is it for?Examples: .NET Framework 2.0: You will have the features present in version 2.0 of . NET and in the computers "clients", you will need to have . NET 2.0 installed. .NET Framework 4.6.1: You will… 
- 
		0 votes1 answer626 viewsA: How to update a field from a Database table using a Stored Procedure?There are two situations, if you want to use the same procedure for this, you will need to have one more parameter and one condition inside, or, do two procedures: 1-Add text before current text:… 
- 
		1 votes1 answer171 viewsA: Fill a Datagrid with data from a list but stating which columns I want to displaySet the column dataproperty: dgvPesquisar.Columns["cfop"].DataPropertyName = "CFOP"; c#answered Rovann Linhalis 14,881
- 
		4 votes4 answers2013 viewsA: Find the best-selling item along with a particular itemI did something similar to a few days in order to facilitate the user’s life by showing first, the best-selling items to the selected customer, then the best-selling items overall. I believe it’s… 
- 
		1 votes1 answer253 viewsA: What is the best way to store a multi-valued itemin the item table, make a composite key, being: nfe (pk=id) (unique= numero, serie, modelo, emitente) id | numero | serie | modelo | emitente | data_emissao | chave | destinatario | ... nfe_itens… mysqlanswered Rovann Linhalis 14,881
- 
		3 votes2 answers110 viewsA: Visual Studio C# 2015 does not debugThe problem is that you start the application with Splashscreen, this causes the application to continue running after you close the other Forms, possibly after the login you are giving a Hide() in… c#answered Rovann Linhalis 14,881
- 
		1 votes1 answer85 viewsA: Error making an Insert in sql server with c#you are using the Reader after the while(reader.Read()) so at this point he no longer has data. on the line: cmd.CommandText = "INSERT INTO CB0020 (CB0_CODETI, CB0_TIPO, CB0_CODPRO, CB0_QTDE,… 
- 
		1 votes1 answer1933 viewsA: How to handle the Object reference error not set for an object instanceYour code is a little strange, but to treat 'Object reference not defined for an instance of an object. 'You just test if the object is null: if (objFPagto != null) { txtCodigo.Text =… c#answered Rovann Linhalis 14,881
- 
		1 votes3 answers55 viewsA: I tried a Union consultation but did not get the expected resultIf you want two different columns, you have to separate them, where in the opposite query the value comes null, see if it helps: /*SELECT DA REMESSA*/ SELECT RE.cd_flremequ AS RemessaID… 
- 
		0 votes2 answers78 viewsA: C# error in dymamico click eventI would assign the link in the property Tag from Tile and then pick up by Sender who fired the event: { for (int i = 0; i < 15; i++) { var a = new IniFile("Settings.ini"); var b = new… 
- 
		0 votes1 answer69 viewsA: C# - Outofmemoryexception when searching for thousands of Active Directory groupsI’ve had problems of Outofmemoryexception, I’ve resolved putting the objects out of the loop like this: GroupDTO objGroup; List listUsersGroup; Dictionary dicGroup; foreach (string objectGUID in… 
- 
		2 votes1 answer159 viewsA: c# delete Drawstring in pictureboxTo make a rubber, I used the following command: private void Borracha(MouseEventArgs e) { int t = int.Parse(tam.ToString()); var g = Graphics.FromImage(pic1.Image); g.FillEllipse(new… 
- 
		3 votes2 answers117 viewsA: Streamwriter classin his StreamWriter you can initialize with the parameter Append as true: TextWriter tw = new StreamWriter("arquivo.txt", true, Encoding.Default); To the Encoding.Default it is necessary using… 
- 
		4 votes1 answer164 viewsA: Return of SQL commandI made an example here, but I also could not dynamically inform the number of columns. I hope it helps: create table suprimentos ( codigo varchar(20), modelo varchar(20)); insert into suprimentos… 
- 
		1 votes2 answers552 viewsA: What are the requirements for running a C# program on a client’s machine?try to do this: In the "Copy Local" option mark as true, and Compile the project… c#answered Rovann Linhalis 14,881
- 
		4 votes2 answers554 viewsA: How to make the main form invisible c#It has to be with Hide anyway, I just tested it here, and it works: private void button3_Click(object sender, EventArgs e) { Form2 f = new Form2(); f.Show(); this.Hide(); }… 
- 
		0 votes2 answers426 viewsA: Httpclient how to make a request every 1 secondFor this you can use a control Timer, which can be dragged directly from Toolbox. Set the property Interval for 1000 (milliseconds) = 1 second, and manipulate the event Tick, placing the request… c#answered Rovann Linhalis 14,881
- 
		0 votes1 answer964 viewsA: c# Take text and insert on top of imageYou need to get the graphics from the image, not from the controls or form: var g = Graphics.FromImage(pictureBox1.Image); This is a method I use to draw a circle on the image: private void… 
- 
		1 votes1 answer771 viewsA: XML Serialization, how to doI believe I’ve solved the problem: I deleted the class generated by xsd2Code and remade by command line, using the tool xsd.exe with the following command:… 
- 
		0 votes2 answers183 viewsA: Reference System.ConfigurationOnly you go in the Assemblies, and not in your own Solution: In your project, References, Right-click, Add Reference:… 
- 
		1 votes1 answer771 viewsQ: XML Serialization, how to doI need to generate XML in the TISS standard of the ANS. I got the schemas available on website, and by xsd2Code generated tissV3_03_02 classes. I installed an object of the type ctm_guiaLote and now… 
- 
		0 votes2 answers206 viewsA: Network connections between processes within a machineDoes anyone know why Windows does this? Rather than simply (and only) using inter-process communication? (Pipes, fifos, messages, signals...) It is not quite windows that does this, there are yes… 
- 
		2 votes1 answer127 viewsA: Constrait Oracle GardenIn the case of: CONSTRAINT PAIS_UNIQUE UNIQUE (NomePais, SiglaPais) The columns will be analyzed together yes, which will result in: 'Brasil' | 'BR' <- Permitido 'Brasil' | 'BR' <- Violação… 
- 
		3 votes1 answer293 viewsA: 1060 - Duplicate column name 'NULL' in a Mysql querydo so: (SELECT 2,1,2002,NULL as ltr,NULL as issuing,'wallet') assigning an alias, no duplicity will occur 
- 
		2 votes1 answer1481 viewsA: How to compile/buildar a DLL?You need to create a Classlibrary-like project in an existing project, you can change the output type in the project property: and yes, when compiling, a dll will be generated… 
- 
		4 votes1 answer108 viewsA: Select hard with dateSee if this is the expected result: 1- Find the shortest date after the value is changed. Ex: 23.77 2017-05-01 21:40:12 23.93 2017-05-01 21:40:13 there was change in value, then the date following… 
- 
		2 votes1 answer71 viewsA: Add mysql columnsJust use the function SUM(coluna) in the memory column, and group by the others which shall be equal, by Group By Follows code: SELECT C.id, C.name as NomePC, C.serial AS Serial, MF.name AS… mysqlanswered Rovann Linhalis 14,881
- 
		1 votes2 answers49 viewsA: How do I list all fields from one table plus a random value from another table?see if he answers you: SELECT a.id as id_anuncio, a.titulo_banner, (SELECT b.img FROM tb_adm_anuncio_banner b WHERE b.fk_anuncio = a.id ORDER BY RAND() LIMIT 1 ) as imagem_banner FROM tb_adm_anuncio… 
- 
		0 votes4 answers2146 viewsA: SQL - Draw random linestaking advantage of Vitor’s idea for the order by newid(), because it seems to me that Rand() did not work. select distinct t.ordem, (select top 1 x.rodada from temp x where x.ordem = t.ordem order… 
- 
		2 votes3 answers1525 viewsA: How to create an incremental Update sql commandI believe it can be done like this: Create a temporary table, using the row_number() function to number the rows. Update the stock table by selecting the sequential number from the temporary table.… 
- 
		1 votes3 answers186 viewsA: How do I trigger confirm the form via enter?I use this function for this, apply to all controls to use the Enter to jump to the next. Function code: public static class Funcoes { /// <summary> /// Ao pressionar ENTER no controle, ele… 
- 
		2 votes3 answers52 viewsA: Multiple foreign keys in a single queryJust make the Join between the tables, relating them by the respective foreign keys: Select c.nome_carta, e.nome_edicao, e.serial, t.tipo, c.efeito_desc, c.atk, c.def, c.link_img, a.atributo,… 
- 
		1 votes1 answer222 viewsA: Query SQL returns records only after 2 days prior to todaytry the following code, see if it works because I did it blindly since it does not put the structure of the tables and I have no way to test here: SELECT S.SolID, T.TraData FROM Solicitacao S INNER… 
- 
		1 votes1 answer163 viewsA: SQL comparison with values written in different waysI wanted to understand why to store 'jan' in a column in the database, puts... but, come on: You can make a Case When directly in the query, or create a function for this, as I imagine you will have… sqlanswered Rovann Linhalis 14,881
- 
		0 votes3 answers650 viewsA: How to copy a data snippet from a string?Surely there are several ways to do this, I tried to make a didactic code so you understand the logic, I hope I can help: //Exemplo da mensagem recebida string mensagem =… c#answered Rovann Linhalis 14,881
- 
		0 votes3 answers1640 viewsA: Datetime function C#You can also use the ParseExact when you want to convert a date to a specific format: Usage: Datetime.Parseexact(string value, string format, Iformatprovider) Format: For your case, we can use the… 
- 
		5 votes1 answer44 viewsA: Why is my WHERE statement in Mysql not working?The problem is in the OR operator, which kills all previous AND, you must specify when it will be processed using parentheses: (fornecedor_credito.qtd_credito >= '2') AND… 
- 
		2 votes4 answers708 viewsA: Conversion of interface list into object list: (List<Interface> in List<Object>)It is not very clear your problem but I believe you can use keyword new instead of overwriting the method: namespace ClassLibrary1 { public interface IObjetosBase { IList<IObjetosBase> get();… 
- 
		1 votes1 answer49 viewsA: Error of datetimeyou have to use the property Value of DateTimePicker: Example: tempoInicialEXP.Value.ToString(); tempoInicialEXP.Value.ToString("dd/MM/yyyy HH:mm"); tempoInicialEXP.Value.ToShortDateString();… 
- 
		2 votes3 answers270 viewsA: Searching data in databaseI believe the error is in this section, check: echo “</table>”; </table> <---------------------------- mysql_close(conexao); Also, change your mind “ and ” for " or ' Corrected code:… 
- 
		4 votes2 answers1018 viewsA: How to split elements of an array using the For loop?You can start the result with the first position of the array, and the loop start from the second, just a hint: case "4": { result = num[0]; for (i = 1; i < arrayLength; i++) result /= num[i]; }… c#answered Rovann Linhalis 14,881
- 
		0 votes4 answers166 viewsA: C# WPF How to separate a long string into several positions of an Array?I made this kind of example, which meets your need. I have not done error treatments, nor the origin of the data. public class Teste { public Teste() { //Chamo o método de carregar a List<>… 
- 
		4 votes1 answer95 viewsA: SELECT Union ALL Disregard ArgumentsYour problem is being these OR within the query, first it doesn’t make any sense YEAR(data) <= 2016 or YEAR(data) < 2016, only YEAR(data) <= 2016 is equivalent to this, and then all the… 
- 
		1 votes2 answers105 viewsA: interpret string C#I use the following function: /// <summary> /// Calcular Formulas /// </summary> /// <param name="evaluationString"></param> /// <returns></returns> public static… c#answered Rovann Linhalis 14,881