Questions tagged as 'c#'

2
answers

Remove objects from memory

I have DataGridView in my project and a timer refresh of 5 seconds. I realized that the system was overloading the memory, because every time I list the previous data, they remain in memory. This is the code I use to list: Using (DBE...
asked by 03.02.2015 / 12:19
2
answers

How to return an int in a Decimal property

I have a SQL string (made by another programmer a long time ago so I can not change it) which returns something like this: If it has value in the column, it returns the value, otherwise it returns 0 (I would post the SQL here but it's gigantic.)...
asked by 01.07.2014 / 15:41
2
answers

Limit the number of characters in a textbox

I am simulating an electronic urn in C #. To limit data entry, I decided to create a "keyboard" from 0 to 9, for the insertion of the votes. However, I'm having trouble limiting the amount of characters in the textbox, even setting the maximum s...
asked by 22.09.2018 / 04:12
1
answer

C # - How do I check if 2 arrays have one or more numbers in common?

int[] numeros = new int[] {text_box1, text_box2, text_box3, text_box4}; int[] pares = new int[] {02, 04, 06, 08, 10}; int[] impares = new int[] {01, 03, 05, 07, 09};     
asked by 29.09.2018 / 04:58
1
answer

Random in the switch statement, why does not it work?

Following the code below, my intention was to randomize the switch to choose between case 1 and 2 after receiving the word "gamble". It turns out that when I type gamble, only case 1 (add 10 irons) is activated, instead of being random between a...
asked by 30.08.2018 / 05:04
1
answer

Failed to get a .txt file for download

I have a method where after a query, I create a .txt file saving some parameters. My need is to get this .txt, where I will treat this file in a JavaScript (angularJs) to download. But when I try to get this file, I get a return with the erro...
asked by 11.09.2018 / 14:22
2
answers

Transforms string into decimal within an object

I made a ViewModel, where in the database the CPF field is decimal (11,0) and in the VM I put it as String. In my API the CPF is decimal. Well, when I fill in the field and send the form to the API, the value of the CPF arrives with 0.0. This is...
asked by 13.08.2018 / 14:11
2
answers

Separate String with .Split - C # [duplicate]

Good morning, I'm trying to get a specific part of a string in Visual Studio, in case the string in question is a directory path: "C: \ Users \ User \ File-2018.txt" I would like to try to get only what comes after the last "\", I tried to...
asked by 13.08.2018 / 16:16
2
answers

ORA-01036: illegal variable name / number

I have a small problem with my application. The INSERT routine gives me its error:    ORA-01036: illegal variable name / number Remembering that the bank is Oracle and the application in C #. Here is the code that generates the error:...
asked by 01.08.2014 / 15:55
1
answer

Difficulty in positioning table on screen with bootstrap - layout only

I need to do a layout on my page, as follows. That I have three textbox controls, one underneath the other and taking the other side all the rest with a table. See below how I need it. Ihavetriedinmanyways,reducingmygridfrom12to6andwhathappenswh...
asked by 29.08.2014 / 13:21