Questions tagged as 'c#'

1
answer

Is there any advantage in avoiding type specification redundancy?

Given the following code: public override Entidades.ControleAcesso.Perfil PreencherEntidade(IDataReader dr) { return new Entidades.ControleAcesso.Perfil() { Codigo = Fie...
asked by 09.05.2014 / 15:14
1
answer

How to use multiple App.config

How to use more than one App.Config? I have a Solution with several projects. In each project there is an App.Config. When I try to read a key, either by AppSettingsReader or System.Configuration.ConfigurationManager.AppSettings th...
asked by 23.08.2017 / 19:08
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
1
answer

Delay Sending Email with Attachment

I'm trying to send an email with an attachment, without an attachment, the email sends quickly, without any problems, but when I put the attachment, it takes a lot of minutes, and it hangs, and it does not send. I wonder if there is some way I...
asked by 13.07.2017 / 13:26
1
answer

How does MVVM really work? [duplicate]

How does MVVM really work? What are the responsibilities of ViewModel and Model? I've been implementing a project with MVVM pattern for some time, but now some questions have come up about the pattern. Where to implement the IN...
asked by 30.08.2016 / 18:22
1
answer

DateTime field display in View without part of Hours

With the code below I'm retrieving the DateTime with the time beyond the date, which I do not like. cursos.Data = DateTime.Parse(collection["Data"]); I tried to format using the substring within DateTime.Parse, but I did not succeed. My...
asked by 01.08.2014 / 14:41
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

Identification of regions google maps - JavaScript

I have a list of latitudes and longitudes and I would like to find out in which region of the country such latitude / longitude belongs.     
asked by 22.10.2015 / 21:39
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 do I block menu buttons, when a form has not yet been saved, is it possible?

I'm new here. I'm starting in C # and I came across the following doubt: I have a form, where I have not yet given a post yet, and I did not want to let the user leave this screen without saving. What is the best practice for doing...
asked by 30.09.2015 / 20:03