Posts by Paulo Ricardo • 895 points
54 posts
-
0
votes2
answers289
viewsA: Add Object to a List with C#
Try this! public class CenaCozinha : MonoBehaviour { //Os Alimentos public GameObject Alimento; public GameObject Agua; public GameObject Melancia; public List<Alimentos> alimentosCozinha; //…
-
0
votes1
answer70
viewsA: How do I subtract and display the result in the MYSQL query
You can use the Function TIMEDIFF() which aims at returns the difference between two time values (expressed as a time value). Add: timediff(proximatroca, max(horimetro)) as Horas Restantes Would…
-
1
votes1
answer3217
viewsA: Assemblies not found for Visual Studio
I’ve had the same problem. Navigating to the folder bin, you can check line 1126 of the file `Microsoft.Common.Currentversion.targets. Soon you come across: <!-- By default if there is no root…
-
0
votes2
answers917
viewsA: Fill several combobox
You can do the same type of procedure using a MySqlDataAdapter to fill your DataTable. Once you have the table populated with the data only use the properties of the ComboBox and of CheckListBox:…
-
2
votes1
answer150
viewsA: Doubt about the Messagebox
The MessageBoxis a public class of namespace System.Windows.Forms{}; The .Show() is a static method of the Messagebox class that has as the return type a Dialogresult; You can view this information…
-
1
votes1
answer69
viewsA: What’s wrong with the program?
As the bfavaretto commented the error happens by this inversion. In your conditional structure you set the variable n1 and n2 with the variable maior and menor being that smaller and larger were…
visualganswered Paulo Ricardo 895 -
0
votes1
answer1082
viewsA: Combobox.Selectedindex does not return the item in Windows Forms
You are creating a model (CboxModel), just to add a simple text (Select a nature), you have tried using a Label to illustrate such a text? Try it like this: The estate .SelectedIndex receiving -1,…
-
2
votes3
answers49
viewsA: Send information from a Viwer Data grid to sql database
It lacked to give more information and put the code you have tried. Supposing that the bank is the SQlServer, and your grid has 4 columns, would be like this: I don’t know what kind of data you use,…
-
0
votes1
answer120
viewsA: Error in "if so" are accepting everyone in the answer
Debugging your code I noticed that the variables that represent the female names of the type logico were receiving the variable l which in turn was being fed verdadeiro after printing the first…
visualganswered Paulo Ricardo 895 -
4
votes1
answer1087
viewsA: How to validate Combobox?
You can check the property .SelectedIndex of ComboBox. She returns a int representing the position(Index) of the item in ComboBox. Add to that: else if (suaComboBox.SelectedIndex.Equals(-1)) {…
-
1
votes1
answer531
viewsA: Loop repetition in programming logic algorithm
You can use the command interrompa to repeat after reading the data: Follows the code: se (idade < 0) entao interrompa fimse Following illustration: see your code running perfectly: Entire code…
-
5
votes1
answer59
viewsA: How to detect when the mouse is pointing to a button
You can use the Event MouseHover button. To use it, simply select the button you want to add the action and in the Properties window in the top bar click on Events (the icon is lightning): After 2…
-
0
votes1
answer50
viewsA: Postgressql connection with Visual Studio
you can create a Class for this: Only before that we’ll add one ConnectionStrings at the App.config of your project. Once located and opened the App.config before the closing tag…
databaseanswered Paulo Ricardo 895 -
2
votes2
answers119
viewsA: Call Method C#
Try this: private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text)) { textBox1.BorderStyle = BorderStyle.None; this.CreateGraphics().DrawRectangle(new…
c#answered Paulo Ricardo 895 -
2
votes2
answers2572
viewsA: How to change button color using RGB or Hexadecimal code?
using .FromArgb()tbm is possible to control the Alpha channel that accepts a int from 0 to 255. //--> ARGB o Alfa vai 0 à 255 button2.BackColor = Color.FromArgb(100, 250, 0, 100);…
-
0
votes1
answer25
viewsA: How to not save value in the list if(seal)
After instantiating the Agedamento agenda; and assign its values, you can use the method .Contains() from the list - to check if Schedule already exists. An example: if…
c#answered Paulo Ricardo 895 -
2
votes1
answer111
viewsA: saveFileDialog, select the last modified folder
Remove InitialDirectory = @"\\M12971\Imagens$" of saveFileDialog1 and add saveFileDialog1.RestoreDirectory = true;. This should solve your problem, see an example below:…
c#answered Paulo Ricardo 895 -
1
votes2
answers99
viewsA: System.Nullreferenceexception: 'Undefined object reference for an instance of an object. '
First of all, you could have added your code to your question using the Edit function. I did not try to pay attention to buttons and design in general and yes to the problem. From what I can make…
c#answered Paulo Ricardo 895 -
4
votes1
answer145
viewsA: How to transfer from one Combobox to another (C#)
From what I understand, you want to select an item on ComboBox, push one button and move it to another ComboBox. I set up a scheme here... I hope it fits. Imagery: Code Used: private void…
-
1
votes1
answer72
viewsA: Event pressing key 2 times
A method to check empty control: bool CheckVazio(Form formulario) { foreach (Control item in formulario.Controls){ if (item is TextBox && !((TextBox)item).Text.Equals(string.Empty)) return…
c#answered Paulo Ricardo 895 -
1
votes2
answers421
viewsA: My C# software with SQLEXPRESS Localdb database does not open on another PC, even installing all dependencies
Use the Data Directory to signal that the database is located at the root of the application. Thus: <connectionStrings> <add name="CaminhoSQL" providerName="System.Data.SqlClient"…
-
0
votes3
answers4592
viewsA: How to do exponentiation using multiplication in Portugol as arithmetic operation?
I believe that’s what you’re looking for: Follow below Code used: algoritmo "semnome" // Função : Exponenciação por Multiplicação // Autor : Paulo Vieira // Data : 20/03/2018 // Seção de Declarações…
-
0
votes2
answers118
viewsA: Reading Files in C#
Exactly I just redo. Don’t forget to convert the code because it is whole.…
-
3
votes1
answer50
viewsA: How to open an Openfiledialog box when selecting a Tabcontrol Tab?
You can overload 2 Control event TabControl: Selecting -> is triggered when the TabControl is being selected. Selected -> is triggered after selecting the TabControl. You can find events…
-
0
votes2
answers2827
viewsA: SQL Server Create a filter in a Datetime field, bringing the previous 24 hours (not counting the current time)
You can use the Function DATEADD() returns 1 day before the exact time of the filter execution. The function takes 3 arguments: The interval ex:(day, Month, year and etc); The number of days…
-
2
votes1
answer265
viewsA: How do I Inner Join with these tables?
Suppose these are the tables: Table of Members CREATE TABLE Integrantes( ID INT AUTO_INCREMENT PRIMARY KEY, Nome NVARCHAR(50) NOT NULL, ); Band Table CREATE TABLE Bandas( ID INT AUTO_INCREMENT…
-
0
votes1
answer137
viewsA: Synchronization of Phpmyadmin tables
You can use a TRIGGER for this, see below: Table1: CREATE TABLE Teste1( ID INT AUTO_INCREMENT PRIMARY KEY, Nome NVARCHAR(30) NOT NULL ); Table 2: CREATE TABLE Teste2( Teste1ID INT PRIMARY KEY,…
-
1
votes3
answers864
viewsA: Search two Mysql tables and select rows with a common element
There are numerous ways to use the Foreach repainting loop, as a basis in your question I have elaborated a simple example to show use of Join and Foreach. Database construction (Note that I used…
-
0
votes1
answer126
viewsA: database backup
On a Server it is common to use the SMO library for backup or restoration. SMO | SQL Server Management Objects contains numerous classes that facilitated and greatly managed a bank in a programmatic…
-
0
votes1
answer38
viewsA: Mask for variable size input field with windows Forms
You can use namespace System.Text.RegularExpressions; to generate a rule and calculate it where you wish. I created a very simple example to illustrate the use of the class Regex, where I run the…
-
0
votes1
answer229
viewsA: Range defined by SQL user
Yes, there are many ways! How you attached the SQL tag, deduce that you are using T-SQL to write your queries. Then analyzing the question with proposed example I came to... SELECT nomeDaColuna(s)…
-
2
votes1
answer618
viewsA: Remove form button and remove code
Probably the error should that after deletion: This happens that when you click 2 times in control to create an event it links the event in Form1.Designer.Cs, so if you simply delete the event in…
-
2
votes1
answer37
viewsA: Sqlserver // Tables
If you used this order when executing the query, probably your tables should be in DATABASE master. If you run a query without setting a DB, by default it will adopt the DATABASE commands called…
sql-serveranswered Paulo Ricardo 895 -
0
votes1
answer930
viewsA: System.Nullreferenceexception: 'Undefined object reference for an instance of an object
I usually use a Static class that always returns a new Instance of SqlConnection for each operation. didn’t understand the SqlConnection con = null. Another thing is that you can return the direct…
-
0
votes5
answers32003
viewsA: what formula do I make for ranges of values in excel?
I just made one here, I do not know if it fits what you intend to do, but the formula works in the same reasoning as what was requested. Formula:…
-
0
votes3
answers2912
viewsA: Create Trigger with update setando field through a function
It is possible yes Pedro, I created a quick scheme here to show that it works. Follow image below: Noting that the Function returns the same type of data from the Field in question as in the example…
-
1
votes1
answer1133
viewsA: How to recover Mysql database tables with corrupted operating system?
you can connect this hard drive (with Server 2016) to another system, and browse to wampserver root - each bank has a folder in the directory C:\wamp64\bin\mysql\mysql5.7.19\data if your Wampserver…
-
2
votes1
answer346
viewsA: Relationship between 4 tables
Amiraldo observing your scheme, as Motta commented, it is not necessary to create 4 tables, just create 2 where one stores the data NORTH, SOUTH, EAST and WEST (each with its respective ID) and the…
-
0
votes1
answer24
viewsA: Error writing in SQL table from Windowsform
The exception is of the type ArgumentNullException, for the SqlParameter makes an internal conversion using the System.Int32.Parse(string) to collect property data parametro.Value. If value is null…
-
1
votes2
answers82
viewsA: Relationship of 1 attribute with different tables
Here is a simple example that I have just created in view of your question. Below is an image: Looking at the example I think you can create one according to your needs. I hope I’ve helped.…
-
0
votes2
answers479
viewsA: Trigger to connect multiple records
given your request rewrote, due to the changes made prefer to post as another response. Like the TRIGGER does not accept parameter, to add a direct user in the match with a challenge already…
-
1
votes1
answer110
viewsA: Select does not work Mysql
You can create a PROCEDURE to handle this situation. Follow a simple example: Note that this is not the solution to the project because I’m using fictitious field names, it’s just a process that…
mysqlanswered Paulo Ricardo 895 -
0
votes1
answer76
viewsA: select data from a sql server database in C#
Supposing that the Lista<> be a Lista<Pessoas> ListaDePessoas(), and you have all the people according to the return of your Procedure. Following this line of reasoning your Table has…
-
0
votes2
answers230
viewsA: Listview with first column exceeding limit
Well come on, there are 3 types of Auto Sizing Column: ColumnHeaderAutoResizeStyle.None, ColumnHeaderAutoResizeStyle.HeaderSize and the ColumnHeaderAutoResizeStyle.ColumnContent . to adjust the…
-
1
votes1
answer197
viewsA: Difference between connecting tables with WHERE and with INNER JOIN
Here’s a visual example of my comet: Assuming we have two tables with a ratio of 1 to 1 Note the filter behavior of WHERE in the two consultations and in the 2nd Consultation observe the INNER JOIN…
sqlanswered Paulo Ricardo 895 -
0
votes3
answers878
viewsA: App.config to access an SQL Server database?
You can add a Connectionstring. Right after the tag startup in his App.config you can add: <connectionStrings> <add name="ConexaoSQLSERVER" connectionString="Data Source=EnderecoServer;…
c#answered Paulo Ricardo 895 -
-1
votes2
answers1301
viewsA: Sum 2 arrays with equal indices
from what I understand it is possible to do so too: <?php /*Obtendo Produto via POST e armazendo em array.*/ $Dados = array([Produto] => $_POST['produto'], [Quantidade] =>…
phpanswered Paulo Ricardo 895 -
2
votes1
answer77
viewsA: Insert Mysql query value in a comma-separated array
Blz, here we come: From what I understand, your consultation and connection are okay. Just use the mysqli_fetch_array(), it has an array as the return type. <?php $Conexao =…
-
0
votes2
answers223
viewsA: Scroll through buttons and text box with tab
There is also the possibility to configure the property of all components in the Form. The Tabindex property. VC can config via panel or code. The property is in the property panel of all…
-
0
votes2
answers1436
viewsA: How to center layout
you tbm can do via code: Knowing that the center of the Container is half its width . Width / 2 and half its height . Heigth / 2 control. Top = (Container.Heigth / 2) - (control.Heigth - 2);…