Questions tagged as 'c#'

4
answers

Breaks row in table cell in CSV format to be read by Excel

I have the following code that inserts a value into an excel cell for export context.Response.Write("aa\r\nbb\r\nccc"); o / r / n breaks the line but writes in the cell below, I would like to break the line but continue with the text in the...
asked by 03.04.2014 / 17:41
1
answer

Add buttons in the DataGridView cell

I'm developing a Windows Form C # activity control application for a company, however I would need to display the activities as buttons within the GridView cell. I've tried: DataGridViewButtonColumn uninstallButtonColumn = new Data...
asked by 08.01.2015 / 18:16
1
answer

DataAnnotation: How to validate "e-mail" property, check whether or not it exists in the database, with attribute not being in the client but in the Server

I have a layered application, and in my presentation layer, I have a ViewModel that is UsuarioViewModel within this I have a property call public email {get; set;} . > that is being registered already exists in...
asked by 05.01.2015 / 21:39
2
answers

How to know which component is in focus?

I'm doing a form (Windows Forms) in C # and would like to know how do I get the component that is in focus. In my form there is a SplitterPanel and inside it, in Panel2 , has TabControl with several: ComboBox , TextB...
asked by 29.12.2014 / 14:21
1
answer

How to show the build version?

I see in some pages and systems the build version. I would like to show in a view the build version of my project in ASP.Net MVC     
asked by 31.12.2014 / 19:25
1
answer

Problem Initialize List for ASP.NET MVC validation

I have an action that receives a user file. [HttpPost] public ActionResult UpdateFicheiro(FicheiroViewModel model) { var listaDeFicheirosJaAnexados = servico.obtemficheirosJaAnexados(); model.ficheirosJaAnexados = listaDeFicheirosJaAnexa...
asked by 22.11.2018 / 10:01
3
answers

Convert string positions to integer

Console.Write("Digite um numero de 4 digitos: "); string numero = Convert.ToString(Console.ReadLine()); int soma = 0; for(int i = 0; i < numero.Length; i++) { soma += Convert.ToInt32(numero[i]); } Console.W...
asked by 13.12.2018 / 01:20
3
answers

I can not do dependency injection [duplicate]

I'm working with ASP.NET CORE 2 and it's a Layer application. This is my ConfigureServices no Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddTransient<DbContext,...
asked by 13.12.2018 / 13:26
1
answer

Validate delete in controller, return html helper

I have my registration, which was done using Scallfold's visual studio In my view: @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-actions no-color"> <input type="submit" value...
asked by 12.06.2014 / 02:30
2
answers

Class that selects the product name or code or value

I'm doing a class that will get one of three values, and will list the field that I fill in, I'll type the product name or the code or the value and it will list me. I need help to make the following condition: if I type the name it will bring m...
asked by 18.06.2014 / 01:52