Questions tagged as '.net'

1
answer

Insert the value of an attribute into a textBox

I need to insert the value of the SALDO attribute of the Conta class into a TextBox . In java redirection via method get and convert with parse.float and hedge as string in field. How do I run C #...
asked by 20.04.2017 / 15:39
1
answer

Access Denied when saving image in an application

I made a Silverlight application that captures image using the web cam. The application works perfectly however when I save the captured image it generates the following error:    File operation not permitted. Access to path: 'D: \ Web ....'...
asked by 29.09.2014 / 19:26
1
answer

How to create an asynchronous method that is cancelable?

How to create an asynchronous method that is cancelable? In this context, the DoFoo() method does things that can not be simply stopped, such as reading and writing files, and by canceling, I have to wait for these I / O operations to...
asked by 28.07.2017 / 15:41
1
answer

MemberwiseClone of aggregates

I have in memory (not yet stored in database) an object of type List<NotaFiscal> . I need to pass an item from this list as a parameter to a screen, so that changes are made to that object. However, it may be necessary for the user t...
asked by 20.02.2017 / 19:28
3
answers

Dollar next to number in ToString formatting

When I try to format a value using .ToString("c2") .NET, the currency symbol is stuck with the number. This makes the formatting ugly and wrong to my point of view. Example: cdec("1234.56").toString("c2") | Resultando: "R$1.234,56"...
asked by 03.12.2017 / 16:22
2
answers

LINQ using function within select new {} with lambda expression

I am assembling a select, with the Entity Framework, that needs to "create a column" according to 4 criteria. I'm trying this way: IQueryable<ImoveisDTO> Resultado = ctx.Imoveis.Select(ib => new ImoveisDTO { idImovel = ib.idImovel...
asked by 04.01.2018 / 13:04
1
answer

Is there a reliable way to test your internet connection?

I read about the NetworkInterface.GetIsNetworkAvailable , but it does not work in my case, since I need to check if there is actually an internet connection. I also read about trying to access the Google page through a
asked by 06.09.2016 / 04:46
2
answers

TextBox_Changed is accumulating the value of the sum c #

I am using the textBox_Changed event and when I type a value in the field, another textBox should receive this value, but this other textBox called ValorTotalVenda is accumulating this value. private void textBox4_Te...
asked by 11.01.2017 / 14:36
1
answer

Reload DataGridView in C #

I'm creating an event from a button in which it creates a Product object and adds it to a list of Products and using this list to populate the DataSource of a dataGridView, but the DataGridView always keeps appearing a single product. private v...
asked by 09.01.2017 / 18:43
1
answer

How to replace bar and space by semicolons in C #

I want to create a system that removes all slash and spaces by semicolons, for example 4587 / 5458 = 4587;5458 4587 5458 = 4587;5458 How can I create this system with C #? My code so far looks like this: private void bt_validar_Click...
asked by 05.08.2018 / 04:21