Questions tagged as 'c#'

1
answer

Remove form button and remove code [closed]

Good afternoon, how can I clean the code in the situation where, I put the buttons according to a certain use, then we resolve to take the buttons but the codes are there, (click events) How can I remove the button and remove events and referenc...
asked by 08.02.2018 / 17:58
1
answer

What is the problem with this form?

Well, I have an asp.net mvc application that will have only one page, which is index.cshtml. On this page I have a contact form, so he is not sending the message he has received to my email, someone would know how to help me solve this, here is...
asked by 09.02.2018 / 18:50
3
answers

Object reference not set to an instance of an object. - Json

Follow the code below: public class Name { public string type { get; set; } } public class Items { public string type { get; set; } } public class Hobbies { public string type { get; set; }...
asked by 07.04.2018 / 01:48
1
answer

saveFileDialog, select the last modified folder

I would like to know how to do saveFileDialog, open my last modified folder, thus taking the job of the operator to select it. I tried to use this one that I found in the gringo stack, but it did not work: OpenFileDialog dlgOpen = new OpenFile...
asked by 06.04.2018 / 18:31
2
answers

How to change EF6 to create DateTime fields like datetime2

I'm working with EF6 Code-first, SQL-Server database. I encountered the following error when saving an object with DateTime property.    The conversion of a datetime2 data type to a datetime result in an out-of-range value.   ↵The statemen...
asked by 06.04.2018 / 15:37
1
answer

How to return a message warning that registration already exists?

I have a method in CepController RegisterCep that before doing the registration makes some validations and between them, check if there is already a registration for that Cep. I would like to implement a warning to inform the user about the...
asked by 17.01.2018 / 14:48
1
answer

ConnectionString returning null

When trying to execute my project I got the error:    System.NullReferenceException: 'Object reference not set to   an instance of an object. ' I have a bank class with the constructor: public bd() { conexao = new SqlConnection(Confi...
asked by 23.01.2018 / 19:25
1
answer

How to make this email form in C #?

I'm now starting to work with the default MVC asp.net, I created a view for contacts and in it insert a form that when filled in and clicked on the send button will go to my email, so I just made the frontend and did not I know how to do the res...
asked by 23.01.2018 / 17:20
1
answer

Report Modeling in ASP NET MVC

I have several reports in the company, and I need to migrate them from webforms to MVC. My question is .. do I need to create a template for each report? This is correct? If not, how can I do it? For example: I have a report that should li...
asked by 20.02.2018 / 12:10
1
answer

Why am I not handling the _Layout file when I'm handling an error?

I'm doing an error handling using Json Result, when I displayed the error message it should display the formed page as well as it rules in the _Layout file, so the page is loading all white, does anyone know how to solve it? Below the image of h...
asked by 30.01.2018 / 17:04