Questions tagged as 'c#'

2
answers

Inserting data from a datagridview C # into another datagridview giving 2 clicks

I'm creating a sales system. On the sales screen I own 2 datagridview Being the 1st (product research) where I receive the data of the research of the product, and the 2nd (selected products) will be filled with the products selected in the firs...
asked by 02.01.2019 / 17:08
1
answer

How to force method using float instead of method with double?

How to force use the method with float instead of the double method? public static void Dividir(double dividendo, double divisor) { //https://www.codeproject.com/Tips/579137/Division-By-Zero-Doesnt-Always-Raise-An-Exception if (divisor...
asked by 24.08.2018 / 18:48
2
answers

Json Web Token - How to create a token that accesses only a given Controller or Action?

I'm implementing JWT in a .Net Core 2.0 application and would like to know how to restrict tokens access to certain Controllers.     
asked by 27.08.2018 / 15:31
1
answer

Identification of TXT asp.net file space

Good night, I am not able to display line break that comes from my TXT file, I have a TXT file with 5 phrases, but when I put it to display it in the default page, a literal loads the txt file, but the sentences are displayed without breaking li...
asked by 19.10.2018 / 02:19
1
answer

How to implement encryption in the password?

I want to implement password encryption in the user registry. I found here on stackoverflow this post teaching how to use encryption, but I'm in doubt where I should add the code. Should this method be used in the class or controller? pub...
asked by 22.10.2018 / 18:24
2
answers

How to use async / await in methods that return void?

I have a problem with my application, where due to the large volume of processing, my Form hangs. During my research I discovered that a async method solves this, but the functions executed on my "execute" button return void, so I...
asked by 09.08.2018 / 18:21
1
answer

Help with DataTable Server-side

Hello, I wanted to know the best way to create a Server-side DataTable. Some questions I have: The next button does not work, and the log counter does not work either. How do I fix it? I'm using Start and Length in SQL code, is there a sim...
asked by 02.09.2018 / 01:15
1
answer

Error saving file - Already being used by another process [duplicate]

I want to read the TextBox text (WinForms) and save it to the file. It is giving error, saying that the file is being used in another location. StreamWriter escreverentrada = new StreamWriter(@"escreveentrada.txt",true); string va...
asked by 02.08.2018 / 20:48
1
answer

(LocalDB) Update-Database Post-Error Error - "Can not attach the file ..."

I'm trying to use Sql Serves LocalDB in an application with the Entity Framework and Migrations, but when I give the Update-Database command, the following error occurs:    Can not attach the file   'C: \ Directories \ 9-ProjectsMVS \ DB Test...
asked by 06.08.2018 / 19:08
1
answer

How to set checkboxes selected in an array in C #

Hello, I'm new to developing in C # and I have in my form an option for fruit selection Grape [] Pear [x] Apple[] Banana [x] How could I store in an array only the selected checkboxes?     
asked by 08.07.2018 / 19:21