Questions tagged as 'c#'

4
answers

How to create a switch..case with ranges of values?

If a total of days is greater than 30 and less than 60, I do something. If it's bigger than 60 and smaller than 90 I do something else and so on. How do I case ? Is case the best option?     
asked by 26.03.2014 / 13:53
2
answers

Read ZIP file contents without writing to disk

In the program I'm writing, I download a ZIP file over the internet and then need to upload the extracted ZIP files to another place. It turns out that I can not find a way to read the contents of this ZIP file - now a Stream - without first...
asked by 02.01.2019 / 22:29
1
answer

Send Email to my account c #

In creating my program, I put a Form so that you can use it to "Report Error / Suggestions". In this form I put 2 textbox and 1 button . 1 textbox to Subject , and the other to write what you want (message). The button serves to sen...
asked by 11.04.2015 / 03:55
1
answer

Problem with constructor

This is the code for my class: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Banco_Exercicio1 { public class Conta { public string Titular { get; set; } public double...
asked by 07.04.2014 / 19:53
2
answers

Save images to repository and retrieve it through Path with C # [closed]

How to save images to repository and retrieve it through a Path with Asp.Net MVC? Searching in some places, I noticed that saving images directly to the database can have a significant loss of performance in the application.     
asked by 12.02.2014 / 15:01
1
answer

Can I use two insert into the same command

I have the following line of code and wanted to know if it is possible to do two select within a single sql command cmd = new MySqlCommand("insert into FUNCIONARIO('CPF_FUNCIONARIO', 'NOME_FUNCIONARIO', 'RG_FUNCIONARIO ', 'ENDEREÇO_FUNCIONARIO...
asked by 25.10.2018 / 05:09
1
answer

If else of date

I have a viewbag, and wanted to display dates of at most 1 day before the current day, I made the code below, but without success, what alternative would I have? if (item.DataHora < DateTime.Now - 1) { //codigo }     
asked by 01.11.2016 / 05:09
2
answers

How do I make a foreach within the View in a ViewData

These are my ViewData in controller: public ActionResult Acao() { RupturaEntities db = new RupturaEntities(); var _listaUnidade = Enumerable.Empty<object>(); var _listaFamilia = Enumerable.E...
asked by 19.09.2014 / 15:57
1
answer

Change date display format in View

I have the following field that returns me the date as follows: 09/17/2018 11:52 AM How to put it within the default pt. I already tried to put .ToString("dd/MM//yyyy") in model.dtProtoclo but it did not work. <div class="f...
asked by 17.09.2018 / 16:55
1
answer

The page can not be displayed due to an internal server error

I'm having this error while running the application I only have this, I can not even put a break point, because it does not even enter the application. I do not know what to do. This code works on another machine. I copied the code from...
asked by 10.09.2018 / 20:46