Questions tagged as 'c#'

2
answers

C # Windows Forms Generic Object

I have a Desktop application in C # and need to load a dropdown with an "All" option and the rest coming from a database table. To load the dropdownlist I did something like this: cmbOpcoes.Items.Add(new { Id = 0, Name = "Todos" });...
asked by 12.05.2016 / 00:13
1
answer

Receive by Parameter and Manipulate a Generic Object LIST

I need to get a Generic Object List parameter and manipulate it, although I do not understand how to do it. Example: public class Funcionario { public long Id {get; set;} public string Nome {get; set;} public DateTime DataCont...
asked by 20.01.2017 / 23:25
1
answer

Is there any way I can save a published file on a user's PC from a published site?

I am creating a zipped file and need to save it to my user, but when I save the location wherever the file is saved it saves on the server where the site is hosted. Path string zip = @"C:\file.zip"; Moving on to be saved ... using (var...
asked by 09.05.2016 / 15:43
1
answer

How to put a ReadOnly column?

I'm trying to leave only one column of GridView as ReadOnly , I'm doing so: if (id_crm == 0) { textBox2.Text = Convert.ToString(cod_crm()); DataTable dat_itens = new DataTable();...
asked by 04.09.2016 / 18:06
1
answer

Alternative to TransactionScope

I'm using Entity Framework (version 4.4) in an AspNet MVC project with .NET Framework strong> SQL Server . I do not have access to the server where the application is hosted, and from time to time it undergoes some migrations to other se...
asked by 12.09.2016 / 16:28
1
answer

How to refresh the context? ASP.NET

I'm starting to develop in ASP.NET and I always have a little problem. When I need to generate a context (that class that will reference with the bank), example below: I do the following: Botão direito em cima do projeto -> Add...
asked by 11.06.2016 / 01:15
1
answer

Iterations within TransactionScope

I have an Asp.Net MVC project with Entity Framework 5.0 in .Net Framework 4.0. What are the losses brought by a very long TransactionScope ? I have the following code snippet: using(TransactionScope scope = new TransactionScope())...
asked by 08.06.2016 / 20:55
1
answer

How to solve solving debug error in C #?

I am running the release from my C # program on another machine, and it is generating debug enable error. Can you help me with this?     
asked by 29.05.2017 / 23:22
1
answer

Why is the ZipFile function not working?

I found a function in MSDN that I need to use for a program I'm doing. My problem is that when I try to use it it appears as if it did not exist in C # , reminding me that I already added using System.IO; to the top of my program. Do...
asked by 09.06.2017 / 14:12
1
answer

Complex Update Entity Framework

Good morning, I have already asked a similar question, I am trying to complement this view with more information and starting with the most basic. I have the following structure: public class Artista { public Artista()...
asked by 11.02.2016 / 15:37