Questions tagged as 'c#'

3
answers

The null value automatically changes to 0

I'm doing a vehicle registration, I need it to register that whenever a vehicle is registered to zero instead of the value null, I tried by default, but it does not record the information. I'm using SQL Server along with C # in visual studio....
asked by 28.08.2017 / 20:00
4
answers

Difference between two dates, ignoring weekend - working days only [duplicate]

I was looking for something similar, but unfortunately I did not find anything. I found this solution that helped me a lot but it's in Java. How to calculate the difference between two dates by ignoring the weekends in Java without using l...
asked by 14.06.2016 / 19:04
4
answers

Check if user is logged in

I would like to know how to block access when the user is not logged into the system, however, the only page that can be accessed is the Login page and when it tries to access any other page it redirects to the login page, user to log on to the...
asked by 25.08.2015 / 15:23
2
answers

How do I store an array in a string? [duplicate]

Example: string x; string[] y = {"5", "0","0","5","5"}; x = "50055" I want to put everything together into one variable. I will store in a non-print variable.     
asked by 18.11.2017 / 22:18
2
answers

How do I know if the screen is in "Extend" mode?

I want to make a if to know if the screen is in "Extend" mode. Example: (Win + P) HowcanIdothisinC#:if(?)//sópodeentrarnoif,seatelaestánomodo"Estender". { SegundaTela formulario = new SegundaTela(); Screen[] telas = Screen....
asked by 19.10.2017 / 22:23
2
answers

How do I convert an enum type to list?

Is there any way to convert a Enum to List ? public enum TiposHospedagem { Casa = 1, Hotel = 2, Pousada = 3, CasaCampo = 4 } I'm trying to get enum and add to the list, but foreach does not want to...
asked by 31.08.2016 / 17:13
2
answers

Difference between BackgroundWorker and Task.Run

Generally when I had to do some operation in background , mainly involving progress bar update or labels I used BackgroundWorker , with its events WorkerReportsProgress and DoWork . Recently I came across the source of a...
asked by 31.10.2016 / 17:48
3
answers

How to compare 2 Arrays with Assert.Equals?

I need to compare two arrays in Assert.Equals . When I test the method on the race, it is correct but the test does not pass. Code: public void SeparaStringTest() { RecebeComando recebecomando = new RecebeComando(); string[]...
asked by 16.03.2017 / 13:07
4
answers

SQL Embedded in C #

I have a C # application that uses a MySQL database with Entity Framework. However, the size of the database is ridiculously small, so I do not think it's worth having a MySQL database server just to run this application. What approach would...
asked by 02.09.2016 / 14:35
3
answers

Create a mask for cpf using xamarin

Hello, I would like to create a mask for cpf using edittext, but I was not successful; I searched the net and found several examples in java, but I could not adapt to C #, could anyone help me? Thank you in advance.     
asked by 23.12.2015 / 17:42