Questions tagged as 'c#'

1
answer

Is it possible to delete "C:" using Directory.Delete?

Using Directory.Delete("C:", true) deletes the partition? Or is it just blocked and does not execute?     
asked by 20.09.2016 / 16:05
1
answer

String truncate when performing append

The code below serializes a JSON list and gives an append variable the result . However, from a certain amount of records (350), the text contained in result has a modified part for "..." . I performed the tests by serializing the entire l...
asked by 05.04.2016 / 15:00
1
answer

Impact of Garbage Collector

The project here is done in Windows Forms and we do not manage the memory very well because it is a legacy system that has several years running. We are currently experiencing problems with a lack of memory on the computers where the system...
asked by 20.09.2016 / 19:36
1
answer

Error, Loop when pressing ENTER with e.KeyCode

I'm trying this code: private void txtEmgSearch_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { this.btnEmgSearch.PerformClick(); } } The command itself works normally, bu...
asked by 23.09.2016 / 22:06
2
answers

Working with Seed Method + FK

I'm finding it difficult to work with the Seed method, since I registered the state, and then wanted to register the cities, and then I can not reference the state in the city, what could I do? I believe you have a solution. Seed Meth...
asked by 29.10.2016 / 00:07
2
answers

What's the difference between creating a Context with DbContext and DataContext?

What's the difference between creating a Context with DbContext and DataContext? Is there any performance difference or best practice between one or the other? See the examples below; namespace _DBContext.DBase.Banco { public class dbCo...
asked by 03.11.2016 / 17:32
1
answer

Access MDF database from the executable folder

I'm having a annoying problem solving because I want my application to access the database file from the folder where the executable is, because on each computer installed this folder may be on a different drive. I found that I should use the...
asked by 15.12.2015 / 21:17
1
answer

Get the largest value inside linq select

Is there any way I can get the highest value of a select do linq field within decimal? , as per the code below? MaxValor = Math.Max(CF.Janeiro, CF.Fevereiro, CF.Marco, CF.Abril, CF.Maio, CF.Junho, CF.Julho, CF.Agosto, CF.Setembro,...
asked by 16.12.2015 / 19:49
1
answer

What is the difference between IEnumerableT and IEnumerable?

I tried to see the code of both interfaces, but the only difference I see is IEnumerable<T> has method IEnumerator<T> GetEnumerator(); , and that in interface IEnumerator<T> Current returns "T" instead of...
asked by 13.04.2015 / 06:53
2
answers

Execute N threads and know when they all finished executing

I have the following problem, I need to run the same N method in a for and know when all the threads have already finished running it. I needed something like this: foreach (MeuObjeto obj in lstObj) { new Thread(delegate() { Me...
asked by 11.04.2015 / 01:06