Questions tagged as 'c#'

2
answers

How can I call a void method of the class to display a msg in a form [closed]

I have a public void listarProduto() method. It needs to have all the input information by the user. My problem is it's time to call this method within a MessageBox() on the form for the message to appear.     
asked by 31.08.2017 / 21:57
1
answer

Show date field value in a listview in a C #

Good evening, everyone. I need to pull values from a data type field (MySQL) and display it in a listview in a C # application. It turns out that the listview shows the value with date and time, but I need only the date to be displayed. How do I...
asked by 11.09.2017 / 01:31
1
answer

How to pass an object or list of objects from Controller to View?

Controller: [HttpPost] public ActionResult Create(Pedido pedido) { List<Produto> lista = new List<Produto>(); if (ModelState.IsValid) { Cliente cliente = unitOf...
asked by 28.10.2015 / 18:04
1
answer

Execute user input in certain number

I'm making a program that calculates a final note by adding the numbers and dividing them by 4. I would like to add the function to type how many notes the user wants. This is the code I have at the moment: int num0; int num...
asked by 22.01.2018 / 01:40
1
answer

Bring the last five into a linq [closed]

I have an event table. And each POS is an event, with Event ID, Date, User and Type. Well, whenever I make an appointment, I populate an event grid. I would like to know how to bring the last five with LINQ and / or Lambda to a same CNPJ? Is...
asked by 27.06.2014 / 18:29
1
answer

Instead of showing text line by line show the whole text

Instead of displaying text line by line show the whole text. Visual Studio Community 2017. Stream entrada = File.Open(varexe + "\Score.txt", FileMode.Open); StreamReader leitor = new StreamReader(entrada); string linha = leitor.ReadLine(); whi...
asked by 31.10.2018 / 21:19
2
answers

I can not get the value of a combobox with WPF

I can not get the value of a combobox with WPF. How do I get the value? This is the code for combobox in XAML. <ComboBox x:Name="cbxCereais" HorizontalAlignment="Left" Margin="145,178,0,0" VerticalAlignment="Top" Width="220"> <Com...
asked by 08.08.2017 / 14:18
1
answer

How to check if an item has already been entered in a list in C #

Classes list exists Within this list I put class objects Each object has (string) nameTurma.Text & a numerical value (int) numericUpDown1.Value I use the addTurma method to place the objects in the groups list pub...
asked by 29.07.2017 / 21:22
1
answer

Orientation Object in C # - Inheritance [duplicate]

Regarding Orientação Objeto in C# , I have the following doubt: What is the difference between inheritance of code reuse , constructor , abstract methods superclasses and subclasses ? It does not refer to the duplic...
asked by 31.08.2017 / 14:32
2
answers

How to create folders within the program's own subfolder? [closed]

How to create folders within the program's own subfolder, even if the user leaves the program anywhere on the computer ? All the media I found would be with paths already determined and the other method was in assembly, however, I'm not fami...
asked by 22.08.2017 / 12:00