Questions tagged as '.net'

1
answer

Making the insert in SQL Server in a float field?

I have the following problem in my code, I have a textbox that receives the value 0.900 , but when I am writing this value to the bank, it is only recording 900, and I need to record the 0.900 and I can not write this way, the field...
asked by 08.08.2017 / 15:00
1
answer

Is it possible to restrict who can use public classes in an assembly?

The scenario is as follows: I have a AssemblyProtegido.dll written in .NET that contains public classes. I would like only specific assemblies to consume such classes. AssemplyProtegido.csproj public class ClasseProtegida {...
asked by 05.01.2017 / 00:12
2
answers

Why do we pass an object to the statement lock?

I'm working with multithreading and fell into a competition case. More than one thread accessed an I / O operation on the same file and so an exception was thrown. To solve the problem, I did so: private static object padlock = new object(...
asked by 10.11.2017 / 12:21
1
answer

What is the usefulness of Task.Yield?

The documentation for this method says:    Task Method. Yield () - adapted from English   Creates a startling task that returns asynchronously to the current context when awaited . I read the source code for it and got lost even...
asked by 24.09.2017 / 12:26
1
answer

Catch the time on a remote computer using C #

Is there any method for me to be able to retrieve the time and date from a remote computer using C #?     
asked by 28.09.2016 / 16:20
1
answer

Calculate cubic root

I'm having trouble creating the following Cube root and LN buttons. I have buttons that should be very similar like for example the normal square root and the log. I tried to create the following for the cube root: private void btn_raizc...
asked by 25.09.2016 / 20:08
2
answers

How to use Filter in FolderBrowserDialog

I would like to know how do I put a filter on certain files using C #. Well, it's more or less like this, I'm doing an application in C # that should open some types of files (in the case .frm), in the "manual" part that would be when the use...
asked by 15.12.2014 / 16:52
1
answer

Passing model via parameter dynamically in .NET MVC

I created this function to generate a handle (or slug , as you prefer) for the model users, the problem is that I would like to make it more "modular", so I can easily implement in any other model you also need to generate a handle...
asked by 24.06.2016 / 18:41
3
answers

How do I add or subtract a digit in the TextBox with a button?

I want to add a number to a TextBox by generating a number when the user clicks the "+" button and subtracts when clicking "-". For example: the random number was 2. If I click on the +, it appears 3. If I click on -, the 1 appears. It...
asked by 25.08.2015 / 16:54
3
answers

Why should I use the typeof keyword to assign a data source to a BindingSource.DataSource?

For example: BindingSource bs = new BindingSource(); bs.DataSource = typeof(object); For what reason should I use typeof(object) instead of just object or even "object" ? edit: As others have asked, here is...
asked by 01.12.2015 / 00:26