Questions tagged as 'c#'

2
answers

Create product classes and photos and initialize

I have a class Produto and within that class I have a class Categoria and a Class Foto . 1 Product may only have 1 category, but may have multiple Photos. The problem is with the photos. I did so: public class P...
asked by 15.01.2016 / 13:38
1
answer

How to resolve the error: The best overloaded method match for

Following the templates this question when I have the following command: "The best overloaded method match for some invalid arguments" Controller public ActionResult Novo() { ViewBag.Nacionalidade = new Selec...
asked by 17.11.2015 / 17:19
2
answers

How to pass an attribute of the child class through the constructor to the parent class

I have 3 classes Mother class: Animal Daughter Classes: Dog and Cat I want to write the name attribute only when one of the objects is instantiated Gato or Cachorro . In the parent class I have the Name attribute that ca...
asked by 28.09.2018 / 19:58
4
answers

Object reference not set to an object instance in array

I have a problem. I have to do a rental program where you tell the data of 5 movies, and then the program lists all the information! And it's mandatory to make a class for this! I have already done the class DadosFilme , and instanciei...
asked by 06.09.2018 / 20:26
2
answers

How to organize an Array by Date order?

I'm trying to organize an array by ascending date order. I was thinking of cutting the parts using the (/) bar and compare it with the other parts, but I do not know if that's the best way to do it. I need to organize the array below:...
asked by 28.02.2018 / 22:55
2
answers

I need to do a SUM within Group BY in Lambda

I'm trying to create a summary report where it consists of doing GROUP BY with SUM , I want to know how I could do this in C # with lambda or hql (Nhibernate), I was able to do a GROUP BY, but I can not puts SUM, an example of what...
asked by 02.02.2018 / 17:28
3
answers

Manipulating TextBox

Simply fill in the fields Modelo , Placa , Km and this will be saved in the multiline fields below: ButwhenIclickthe"Save" button, the result is completely opposite to what you expected. I wanted each field to be one ahe...
asked by 25.01.2018 / 20:04
2
answers

Validate a string with Regex

I need to validate the name of a file that has the following name NWD[0-9] PADRAO - . The literal part will always be the same, what can vary are the numbers. I would like to know how to do this with Regex .     
asked by 12.04.2018 / 21:30
1
answer

The throw statement is leaving the system inconsistent

I have a try..catch and in catch the colleague who did leave just throw. catch(){throw;} Well, my intention is to treat all this exceptions and not only leave throw . But as I arrived here in the company, I arrived and have to...
asked by 27.11.2014 / 16:49
2
answers

Doubt about how to position buttons

Images are for illustration only. What I need to do, is this: There are several buttons with their respective names, and can be called (clicked). I type the name of that button in the search game field and the rest of the buttons d...
asked by 03.05.2017 / 02:50