Questions tagged as '.net'

1
answer

How to know which exception can be thrown in C #?

If in Java I invoke the void cadastra() throws SQLException method for example, I will be forced to add a try catch block or to "re-launch" the exception that can be thrown by this method. So, right away I know which exception c...
asked by 29.06.2017 / 02:34
2
answers

What are the possible cases of using a persistent connection?

I've been reading about SignalR for the past few days and I've basically realized that one of its key features is to maintain a persistent connection of the server to the possible clients by accessing the server. Basically, it allows us to cre...
asked by 06.07.2014 / 01:18
1
answer

How to extract the numerical part of a monetary value?

I have a string with the characters "$ 1,000.00" and would like to extract only the characters "1,000.60". I tried to use regular expression, but I could not reach my goal. I arrived at this: string valor = ""; string texto = "R$ 1....
asked by 16.10.2014 / 20:32
1
answer

How to write an asynchronous method?

I have the following method: public void Contar() { int numero = 1; for (int i = 0; i < 100000; i++) { numero *= i } return numero } Assuming that the Contar() method takes so long to crash the UI of...
asked by 11.07.2017 / 04:09
1
answer

What are symbols in the .NET Framework?

How do symbols work in the .NET Framework (and on other platforms)? How do they make it possible to remotely debug an application even without having the source code on the machine? What is its relation to .pdb ?     
asked by 15.05.2017 / 15:14
2
answers

How to pass variables from the Controller to the View in ASP.NET MVC 4.5?

I'm pretty familiar with MVC in PHP where I can pass the values to view from the controller as follows: public function Index(Users user) { return View('index') ->with('user', $user); } Or to return validation errors: p...
asked by 24.02.2016 / 17:09
1
answer

Error entering data into bank, EF 6

I'm trying to insert data into the database, but I have an error doing saveChanges(); after doing context.add() several times, it's happened after 500, 2200, and 5500 times. Error: The transaction associated with the current...
asked by 16.10.2015 / 22:00
1
answer

How to simplify the code with ForEach's List?

How to use ForEach() of List in the implementation below using System.Collections.Generic; public class Program { public static void Main() { List<Pessoa> pessoas = new List<Pessoa>(); pess...
asked by 17.10.2015 / 01:01
1
answer

In WinForms how do the datepicker cursor move when typing the date?

The question is about the DateTimePicker control of WinForms. When we enter the date, instead of choosing the calendar, the cursor does not scroll. That is, we enter the two digits of the day, and instead of the cursor move to the month, it cont...
asked by 06.04.2018 / 06:05
2
answers

How to find a reserved word in a sentence?

I'm creating a routine to search for reserved words in a text (people's names). I have already tested with Contains() and IndexOf() . It works well most of the time. However in some words the return does not satisfy. Example: CORAL...
asked by 01.11.2017 / 17:50