Questions tagged as 'c#'

3
answers

Check when global variable changes

I have the following problem, I have a global variable public static bool HouveAlteracaoBD { get; set; } and I need to monitor it when there is a change in its value, since I want to follow the following logic: if(Houve alteração na var...
asked by 20.07.2017 / 16:28
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
1
answer

Doubt in the Declaration of Type of Object - Entity Framework

I need help defining the correct class declaration Follow my code: public void BuscaOcorremcias() { //Op 01 - Declarando um IList da Model IList<Ocorrencia> ocorrencias = null; //Op 02 - Declarando um DbSet System.Data...
asked by 24.03.2017 / 20:18
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 to create events in a for loop structure?

My question is the following, I'm developing a program (I'm a beginner) in C #. The part I wanted to improve, is this: I'm wanting to create different events in a for structure. For example: public frmSelecaoDeCartas() { InitializeComponen...
asked by 06.10.2017 / 00:38
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
2
answers

How, after a POST request, receive the JSON return in C #?

I need to have a POST link request, so I also get the json in php . This is the test code in php <?php if(isset($_POST['request'])) { echo $jsonret = '{"request":"sim","name":"'.$_POST['request'].'"}'; }...
asked by 07.11.2016 / 22:31