Questions tagged as 'c#'

2
answers

Create modules using Unity (IoC)

In an application using a multilayer (n-layer) architecture, we have the infrastructure layer where we use an IoC container to register the required dependencies. In a prototype I'm working on, I'm using the Unity Application Block Unity as a...
asked by 13.01.2015 / 11:55
1
answer

Best practices when using SqlCommand? Text or StoredProcedure?

I'm wondering which of the following approaches is best? 1 - Add a file *.sql as Resource , then run SqlCommand with CommandType.Text . 2 - Add a Store Procedure to the Database, then run the SqlCommand with CommandT...
asked by 19.01.2015 / 17:27
1
answer

WindowsPhone - How do you fire an event "inside" another?

I defined the visibility of my combobox as Collapsed, for visual reasons and since the AppBarButton is more presentable. I want to know if it's possible to call the combobox event by triggering the event of an AppBarButton? Something like:...
asked by 24.07.2014 / 04:32
1
answer

Confirmation Mode

I need to create a modal with a warning to the user when he clicks the save button. I already have a similar one that is used for when the user clicks 'Delete' which is in my view / Delete <h4 class="modal-title">Atenção!</h4> <...
asked by 11.07.2014 / 16:21
2
answers

Electron Configuration of a Periodic Table Element

I would like to create a program that would electronically distribute atoms, but I'm not sure how to implement them. Would it be as follows? you would place the atomic number and it would return the electronic distribution (K, L, M, N, O, P, Q)....
asked by 30.07.2014 / 01:58
1
answer

Yield does not return data

When executing the method call, an Enumerable of HTML components should be returned. I'm using the HTML Agility Pack to read an HTML file. The same method works as expected by removing yield and manually adding to a list HtmlNo...
asked by 02.11.2014 / 01:51
3
answers

COMBOBOX dynamically in C # (SQL DB table data)

I need to load a combobox with data from a SQL table DEPARTMENT (with code and description / the description is displayed in the combobox but what is caught is the code) I used a dataSource (the one automatically configured by clicking on> on...
asked by 03.11.2014 / 14:50
1
answer

Access object of a method executed by thread in the background in C # with WinForms

I created a thread to execute a process that takes a lot of time and makes the application process stop for a very long time private void ExeConsultaClientes() { thread = new Thread(new ThreadStart(ExeConsultaClientesst));...
asked by 09.03.2018 / 15:02
1
answer

Method Math.Round does not round correctly

I'm having problems with the Math.Round() method in C #, some values that it does not round properly, I'll give some examples: Math.Round(1190.245, 2) 1190.245 it should round to 1190.25 since it ends with 5 and the 5 i...
asked by 06.02.2018 / 20:29
1
answer

How to find out if TCP Listener is listening?

Library that I use: link Follow the code below: await client.ConnectAsync(address, port); The above code is the client and works normal. Let's say the server is off, when I run the above code, it takes little time and I get error:  ...
asked by 20.03.2018 / 21:07