Questions tagged as 'c#'

1
answer

How to remove the last number from an integer?

How can I remove the last number from an integer? Ex: int value = 123456789; int newValue = 12345678; Note that the new value does not have 9. I know it would be possible to change to a string and use the substring (), but I...
asked by 24.08.2017 / 14:54
2
answers

Sum of TimeSpan in C #?

In the sum of two variables of type TimeSpan with the language c # I could see that it happens as if it were a mathematical operation of two simple numbers, example : TimeSpan t1 = TimeSpan.ParseExact("00:01:45", "c", CultureInfo.Invari...
asked by 06.06.2017 / 22:27
2
answers

Get the current date and time on the internet, in desktop application

I am implementing a system lock by date, and I need to get the current date of brasilia for example, which would be the official time in Brazil, or the date in time zone -3. I believe there are web services that do this and that are reliable,...
asked by 17.04.2014 / 22:13
3
answers

How to do 1: N mapping (one to many) in Dapper?

I'm using the Dapper which is a micro ORM used to map the objects according to the tables of the database following the relational model. So, I have some questions regarding mapping and class structure. To illustrate the situation I created...
asked by 27.01.2017 / 13:30
1
answer

C # Windows Forms Application Slowly on certain machines

Good afternoon, I performed the migration of an application running on a windows ce for desktop, the Application uses Sql Server Compact 4.0. and runs very well in the development environment, I have tested in other development machines and all...
asked by 15.12.2016 / 17:51
5
answers

Is it recommended to use Linq instead of SQL?

To avoid string abuse and avoid code injection problems it may be a good practice to use Linq . I can also imagine, for example, that it be slower. Who has used Linq to communicate with database, would you recommend it?     
asked by 14.12.2013 / 23:31
4
answers

Draw where the name can not be drawn more than once

I need to make a simple draw software, but I do not know how to get the names that were inserted in the list box and draw one among them. The same name can not be drawn more than once. How to do this part?     
asked by 31.05.2014 / 06:19
1
answer

What is the advantage of a semicolon in programming languages?

I know that in programming languages like Java and C #, the semicolon indicates the end of the statement, as in the example below, in C #: System.Console.WriteLine("Hello, World!"); However, there are still languages in which the semicolon...
asked by 27.02.2017 / 01:16
4
answers

How to limit the resources used by the system?

I have a loop of repetition that does several iterations and has in its scope calculations that require a lot of processing. The problem is that when running the code snippet, processor usage will gradually rise, until the application crashes...
asked by 24.11.2015 / 18:24
3
answers

Concepts of Allocation and Release of Memory in C #

I'm doing a web application that has a finite recursive loop. But during the process memory consumption is constantly increasing and in the end Visual Studio has more than 2 Gigabytes of memory usage. I'd like to know some concepts about memo...
asked by 09.05.2014 / 20:01