Posts by Diego Farias • 909 points
36 posts
-
0
votes1
answer30
viewsA: How to run a class code in Android Studio when you don’t have an Activity?
Use this official website of Kotlin, there is the platform and has the tool for you to run only the code and see the result in real time without the need to install Android Studio at this time, so…
-
1
votes1
answer337
viewsA: Captiulo 1, Kotlin in Action, Expecting a top level declaration [Beginner]
Its println function was outside the main function, in case the lock key "}" came before. I tested it here on Intellij and the code works. As you can see the only change I made in this code, was to…
kotlinanswered Diego Farias 909 -
2
votes4
answers6012
viewsA: How to increase memory of Android Studio IDE?
From Android Studio 3.5 it is possible to configure the amount of memory allocated to the IDE directly in the IDE’s settings. Way: Menu File => Settings => Appearance & Behavior =>…
-
0
votes1
answer217
viewsA: How do I validate whether files in a directory are hidden or hidden?
Solved the problem with the code below. Depending would not need to have created a method, however, in my case got better this way. private Boolean IsFileHidden(string arquivo) { var fileInfo = new…
c#answered Diego Farias 909 -
0
votes1
answer217
viewsQ: How do I validate whether files in a directory are hidden or hidden?
Good morning, Everybody. There is a program that prints PDF files that are in a predefined directory. The problem was happening because there were two hidden folder files and the program was trying…
c#asked Diego Farias 909 -
0
votes4
answers1643
viewsA: Variable in message box c#
You can use the method Format class String. Look at the example below: public partial class Form1 : Form { private int c; public Form1() { InitializeComponent(); c = 23; } private void…
-
4
votes2
answers279
viewsQ: Is there a difference in how polymorphism is applied in Java and C# ?
I’m studying the concepts of POO and generated me a doubt. In Java I believe I can access all methods and attributes declared as public in a subclass even when using a superclass type variable to…
-
9
votes1
answer98
viewsQ: What are the benefits of using the => operator in common methods that are unrelated to Lists or Lambda Expression?
I asked the following question: What value is checked in a condition operation with a variable value assignment? and the user @Maniero answered me, however, in the reply he used an operator and that…
-
3
votes2
answers211
viewsQ: What value is verified in a condition operation with value assignment to a variable?
I have a method that does a check and return of this method stored in a type variable bool. When I perform this operation C# tests the value of the variable or the return value of the method?…
-
2
votes3
answers1453
viewsA: Calling form after loading screen
In your main project, in case the project is set to boot your application, in the Program.Cs class write the code as follows that will work. static class Program { /// <summary> /// The main…
c#answered Diego Farias 909 -
3
votes1
answer104
viewsQ: Is there any relevant difference between "Object-oriented programming" and "Class-oriented programming"?
I was reading a post that member @Maniero indicated, and I came across a response from another member that raised more questions and decided to search. In the answer was the following phrase:…
-
11
votes2
answers4107
viewsQ: Concept of class, entity and objects
I’m reading about classes in C#, and an excerpt left me a little confused. I know that classes are objects in C#, and can be used in various ways. My doubt is in the following sentence: "A class can…
-
1
votes2
answers642
viewsA: Problem sending file via FTP C#
I use the following method for UPLOAD and run on the client server without problems, make a comparison or even a test according to your needs and see the result. public static Byte[]…
-
2
votes1
answer881
viewsA: Read data from a column through C#
This is an idea of how you can do, there are n ways to do it, I believe you can return some data to go testing. Within select you can implement a WHERE clause where you will return only records that…
-
4
votes1
answer60
viewsQ: How to create verification that will validate if Reportviewer is installed?
I need to create a check that will validate the installation of Report Viewer on the user’s machine. If not installed, I need to receive this information to make a treatment present a message to the…
-
5
votes1
answer769
viewsA: Database connection in Windows Form?
You can do as follows to use the resource you need: Declare the namespace: using System.Configuration; Below is the class I use to open the connection. using System; using…
-
2
votes1
answer359
viewsQ: How to reset the Datasource property of a Datagridview and not delete the Header columns?
I’m filling my Datagridview with a list of objects, but when I fill the grid for the first time it’s all right. When Seto the Datasource property is null, the grid columns are deleted. There is the…
-
0
votes3
answers626
viewsQ: How to use Lambda expression in List<List<Object>?
Good afternoon I am developing an application, which returns a list list of note items, however, I need to fill some fields with the values of each list of items at a time, however, I am not able to…
c#asked Diego Farias 909 -
4
votes1
answer316
viewsQ: Is there any difference in using the Read() method of the Sqldatareader object?
I am running the code snippet below, however, I was left with doubt related to the method Read() of the object Sqldatareader. using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.HasRows)…
c#asked Diego Farias 909 -
0
votes1
answer73
viewsA: Connection error while performing query
I will do a step by step how to generate the connection string. Search the Services tab. Configure the connection string with the desired database. Configured connection string. Now you can copy it…
-
-1
votes3
answers620
viewsA: How to print the amount of words in a string that gets a sentence in . NET?
Follow a simple example of easy implementation: using System; using System.Text; public class StringClassTest { public static void Main() { string characters = "abc\u0000def";…
c#answered Diego Farias 909 -
4
votes4
answers13213
viewsA: Textbox accept numbers and commas
Try it this way: private void ValidaCaracter(KeyPressEventArgs e) { if (!Char.IsDigit(e.KeyChar) && e.KeyChar != (char)8) { e.Handled = true; } }…
-
3
votes1
answer792
viewsQ: How to set the size of an array of bytes dynamically?
I’m developing an application that creates a arquivo.txt and saved in a column of my table in the database. The problem is in the query of that file. What happens, when I want to do the query I have…
-
0
votes1
answer88
viewsA: Application Service Visual Studio 2015
@GOKU, right click on the main project and properties. When you enter the properties will open this tab for you. Try changing your Assembly name and namespace. And also you can go on the property of…
-
1
votes2
answers4607
viewsA: How to know which button was clicked?
Good night, @Diogo Sousa. I use constants and through them I check inside the Save or Effective button if it is an INSERT or UPDATE command. I also use a property that is loaded with the contents of…
-
0
votes2
answers124
viewsA: Static Datatable, how to load?
@Thomas Eric Pimentel, was looking at your code and I believe that in the class that you populate the Datatable _tablePais, you do not need to pass the class name in front of the object, because…
-
1
votes1
answer438
viewsA: Error while connecting to ftp using c#proxy
@Jeterson Miranda, Good afternoon. I am creating an application connection with FTP, but I did not use proxy, but it was as follows and worked. Analyze the code and if possible make some test, maybe…
-
2
votes4
answers785
viewsA: Should I use a "Try-catch" to identify if a password is wrong?
From what I saw in your code, I think it would be nice for you to use the try/catch with the intention of capturing the exception if the database connection is not established, so you can present a…
-
1
votes0
answers58
viewsQ: What is the advantage of using C#Interface?
Is there a specific scenario for using Interfaces ? If so, how can I know when to use? I’ve always wanted to use in the projects I’ve been creating, but I never know the right time. I know that it…
-
1
votes2
answers2237
viewsQ: Download all files from a folder on FTP?
Good morning, I am developing a system that does file exchange . txt via FTP. I need to download all the files that are in a certain folder. Today I can download one file at a time, in case I pass…
-
0
votes2
answers702
viewsA: How to extract file from an FTP directory?
I was able to solve it this way: public static void StartDownloads(out string pstrMsg, out bool pbooRetorno, string pstrUrl, string pstrLocal, string pstrUsuario, string pstrSenha) { pstrMsg =…
c#answered Diego Farias 909 -
0
votes2
answers702
viewsQ: How to extract file from an FTP directory?
Good afternoon, everyone, I need to extract the files that are in the FTP folders. Following the examples that are in these links:…
c#asked Diego Farias 909 -
0
votes2
answers1164
viewsA: How to make the selected line font bold in Datagridview?
Good night, You have tried using the Grid properties ? Otherwise: Click on the Grid then look in the properties tab on the right side, the properties Rowdefaultcellstyle or Rowtemplate that might…
-
1
votes0
answers1615
viewsQ: Problem: Unable to load file or Assembly. Unsupported operation. (HRESULT exception: 0x80131515)
Good night, I have developed a program and need to implement PDF printing functionality. Doing research on the Internet I found what I need, but there’s a problem. When I run the code in a separate…
c#asked Diego Farias 909 -
0
votes2
answers37
viewsA: How to send data to the constructor?
You can do as follows to pass value using constructor. public FrmDetalheRet(string pstrAba, int pnuNuped, int pnuCdRetPedVda) { InitializeComponent(); if (pstrAba == strConstReceb)…
androidanswered Diego Farias 909 -
1
votes1
answer340
viewsA: How to create C# method to do 2 Query SQL Insert?
Good morning, I did it this way and it worked out for me. Following example: public static void InsereDadosArqTxtRetSaidaDAL(out string pstrMsg, out bool pbooRetorno, ArrayList parrHeaderArqTxt,…