Questions tagged as 'c#'

2
answers

Check two null fields with Data Annotation

I have two properties: public int? Inicio {get; set;} public int? Final {get; set;} Both accept nulls and are not required. I wanted to check if the two are null using Data Annotation . The operation would look something like Compare...
asked by 03.12.2015 / 21:11
1
answer

#if DEBUG always runs, even in release mode

I'm trying to use the #if directive so that a given method runs only after it is published (in release mode). The code is something like #if !DEBUG AlgumMetodo(); #endif I've also tried to add ConditionalAttribute to th...
asked by 27.01.2016 / 13:11
2
answers

Check for installed components

In my project I have a built-in browser so the user can access a certain site that he needs. The browser works, except that it has requirements for the C ++ 2012 library and Flash. Is there any way to find out if these components are installe...
asked by 21.12.2015 / 12:40
1
answer

Install SQLServer with the application

I am finalizing an application and will compile using Inno Setup . The system I am using SQLServer . I will install the system on other computers. Is the database installed on the computers that will receive the application or do I have...
asked by 07.08.2015 / 21:48
2
answers

Improve code performance in C #

I'm doing some testing with some C # code and during an analysis I realized that some high peaking problems happen when whole-valued conversions to string occur, in most cases the conversion happens like this: classe.valor.ToString("0.0")...
asked by 31.07.2015 / 16:57
1
answer

Exception when you will generate boleto bancário with Boleto.Net

I have a system that generates Santander tickets using a specific DLL that has been downloaded from the internet. The name is "Boleto.net". I need to create a Bradesco ticket. I changed where the Santander bank data passed to the Bradesco data,...
asked by 05.08.2015 / 14:27
1
answer

Entity Framework 6 tries to insert FK

I have a small application in C #, WPF and EF6. I'm using Code First , but I'm having a hard time creating a relationship. Look at my code, of the classes I want to relate: I am editing for the final version, if anyone has the same doubt....
asked by 23.07.2015 / 03:44
3
answers

C # update XML based on another XML

Today I have the following XML structure: <ROOT> <TES IDTES="4780" IDPES="17522" /> <TES IDTES="6934" IDPES="12343" /> <TES IDTES="4781" IDPES="17523" /> <TES IDTES="6935" IDPES="12344" /> </ROO...
asked by 16.04.2014 / 22:23
1
answer

What is the equivalent of PHP array_map in C #?

In PHP , I can create a new array based on an existing array , using the array_map function. With it, I can define a callback that is responsible for the settings of each value that will be used to create this "new arr...
asked by 27.04.2016 / 17:34
3
answers

Engine Unity5 error in code

I was creating a code for the one game and in the end some problems appeared: Assets/Scripts/Player/PlayerMovement.cs(63,23): error CS1547: Keyword 'void' cannot be used in this context Assets/Scripts/Player/PlayerMovement.cs(63,26): error CS...
asked by 19.05.2016 / 14:25