Questions tagged as '.net'

2
answers

Better performance compared to strings

What is the best performance option? And memory allocation? Use option 1 or 2? String text = "ola mundo"; Option 1: If ( Strings.len(text) > 0 ) {} Option 2: If ( text != "") {}     
asked by 10.03.2018 / 11:54
2
answers

The property or indexer "Color.Name" can not be assigned because it is read-only

Here is the code where I define SegundaTela : public partial class Form1 : Form { SegundaTela telaSecundaria; } Code: telaSecundaria = new SegundaTela(); telaSecundaria.label_segunda_tela.BackColor.Name = cor_fundo; I get err...
asked by 05.12.2017 / 03:54
2
answers

Can not find the parameter passed to the insert command

I'm developing a web application in ASP.NET and am wanting to insert data into a table in the database, but specifying the parameter displays the following error in the line of cmd.Parameters.AddWithValue("@codigo", this._codigo); :...
asked by 18.07.2017 / 23:20
1
answer

Sort list by string property with number

I have an object of type Ata where I have the property NroAta that corresponds to the number of the Minutes in question, but in the grid when I will sort by this number, it ends up putting the numbers in the wrong order. Ex.:...
asked by 09.09.2016 / 20:53
1
answer

How to hide pictures from the 'Resources' folder?

How do I create a file to put the images in the 'resources' folder? I do not want people using my program to have access to them. The file can be any extension.     
asked by 06.02.2014 / 12:58
4
answers

How do I know if the first character of a string is uppercase?

I need to know if the first character of a string is uppercase and does not let the program follow. How to do it? Console.Write("Digite o nome do " + i + "º rei: " ); kings[i] = Console.ReadLine(); while ((kings[...
asked by 10.10.2018 / 21:20
2
answers

How to remove the value of the last position of the TextBox with the Substring?

How to remove the value of the last position from TextBox with Substring ? Suppose TextBox gets a value with this mascara = 0.00% , however, I just want to save the numbers, not the percent, how do I do it?     
asked by 02.10.2017 / 16:04
2
answers

How do I stop "for" when I find an element in the list?

I have the following code: Console.Clear(); Console.Write("Nome da moto:"); string nomem = Console.ReadLine(); for (int i = 0; i < ListadeVeiculos.Count; i++) { if (nomem == ListadeVeiculos[i].Nomemoto) Console.Write("Preço...
asked by 19.05.2018 / 21:07
1
answer

UserControl, what is it? When to use?

I am studying how to best control users in a WPF application, but I have some doubts about UserControl available in VS 2015. I have already programmed an access control, ie user and login , user registration and etc., but now I need t...
asked by 08.08.2016 / 20:08
1
answer

Calculate square root in C #

I have a calculator made in WPF C # with the basic operations +, -, *, /,%. And now I wanted to try to improve my calculator. namespace calculadora { public delegate float? dlgoperacao(float? a, float? b); public partial class MainWindow :...
asked by 23.06.2016 / 13:29