Questions tagged as 'c#'

1
answer

Disable dates before the current day in DateTimePicker?

Is it possible in DateTimePicker , disable the days before the current day?     
asked by 07.08.2015 / 18:58
1
answer

Centralize (use only one) a try-catch for the entire WPF application

Is there any way to centralize a try-catch for every application in a WPF application with C #? I've created a window to use as a% custom%. When you get an error in any system registry error, does it always fall into the same Messag...
asked by 18.12.2015 / 17:45
2
answers

How ViewModel works in ASP.NET MVC

I have a situation similar to this question where I need to save multiple models at once and relate each one. I would need to kind of cascade save to first save one entity and then go save the others, because of relationships. Following t...
asked by 27.05.2016 / 03:43
1
answer

How to create a function equal to Array.Copy from C # in C ++

I would like to create a function similar to the Array.Copy of C # in C ++. This function has the prototype like this: public static void Copy( Array sourceArray, int sourceIndex, Array destinationArray, int destinati...
asked by 28.01.2016 / 17:47
1
answer

Execute insert in Migrations Entity Framework

I'm developing an ASP.NET MVC project with Entity Framework Code First. I've mapped the bank and managed the first Migrations, my question is: can I run a insert shortly after a table is created? Example: CreateTable( "dbo.P...
asked by 06.01.2016 / 23:08
2
answers

How to create a non-repeating sequential number per user

Work on a bill invoice project, in this project there is the Emissor entity. My database Sql-Server may have multiple emitters. Each issuer can issue its invoices. Each invoice must have a unique, sequential number. This seque...
asked by 14.03.2018 / 19:16
1
answer

Do not find HttpContext.Current

I'm trying to create a UrlHelper as follows: UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext); I have already made reference to System.Web , as I saw it as a solution in several places. using System.We...
asked by 01.12.2015 / 19:09
1
answer

Many to Many relationship problem in the Entity Framework

I have the following situation: To perform an authentication, I am using the old method for a small application, for assigning levels (roles), as many examples that have the web apart. I use EF and Postgres to access / write data and the Flue...
asked by 26.11.2015 / 17:52
1
answer

C # application with connection error with Firebird on Windows 7 32/64 bits with 2GB of RAM

Hello! I am developing a C # application, in which I have already installed it on several machines for testing with windows xp, 7 and 8 and in all of them the application worked correctly, however on a specific machine it just does not run and i...
asked by 09.01.2015 / 13:56
1
answer

What's the difference between using normal methods and Action or Func?

public Action<string> Escrever = (texto) => { Console.WriteLine(texto); }; Being able to call so Escrever.Invoke("Algum texto aqui dentro"); VS public string Escrever(string texto) { Console.WriteLine(texto); }...
asked by 22.08.2018 / 16:55