Questions tagged as 'c#'

1
answer

What causes the 'System.NullReferenceException'?

Sometimes the execution of my systems is interrupted by this error, when it happens, a if(atributo != null) usually resolves, but this pollutes the code, "Ah, but this variable must have a value right?" the problem happens just when I assi...
asked by 30.12.2015 / 13:53
2
answers

Referencing folders created in the project

After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if it were to be used in a controller , I would use as always I used the using nomeProjeto.N...
asked by 21.12.2015 / 14:08
1
answer

Unity change the order of a game object via code by C #

Well I have a Game Object called Party Frames. Inside it I have several prefabs with different names (their names are the character IDs) and they are UIs of character faces. The only thing I want is to change the order of these objects fro...
asked by 06.10.2017 / 18:33
1
answer

Can I create a Win32 application in C #?

I am aware that C # is the right arm of the .NET Framework, and that the default language for programming Win32 applications is C ++. But, can I program an application in C #, regardless of any .NET Framework library? In other words, I can cr...
asked by 08.08.2017 / 05:53
2
answers

What is the difference between async Task and void?

I use async Task with await when I need my code to wait for this task to complete until I run another process. In the case of void methods, without async-await , does my code also not "wait" to execute another proce...
asked by 27.07.2017 / 18:30
1
answer

Various Books for Author

Recently, I asked a question about my problem, but it was kind of difficult to understand, here I will try to summarize my problem. I'm using ASP.NET MVC. I have 2 tables: Autores and Livros , where 1 Autor has many...
asked by 04.12.2015 / 13:08
2
answers

C # - Random prime numbers?

I have a college exercise that is to generate a random primal number, if that number is not prime it must be generating another random one until one is, but it always falls into numbers that are not prime and are in infinite loop, the What am I...
asked by 22.10.2017 / 21:29
2
answers

C # how to do database search using parameters

I have the following code public DataTable PesquisarPorNome(string NomePesquisado) { try { DataTable tabela = new DataTable(); SqlDataAdapter adaptador = new SqlDataAdapter("SELECT * FROM tbEspecialidades WHERE NomeEspe...
asked by 27.11.2015 / 18:04
2
answers

What is the 'let' statement in a LINQ query?

I have the following LINQ query: var source = from em in query select new { Id = em.UniqueID, Data = em.Data == DateTime.MinValue ? "" : em.Data.Value.ToString("dd/MM/yy HH:mm")...
asked by 14.12.2015 / 17:15
2
answers

Get information stored in an "attribute"

In the ORM I use, classes are mapped using Attributes . I need to retrieve the value stored in them. Ex.: [Table("CADASTRO_CLIENTE")] public class Cliente { [Property("Id")] public int Id { get; set; } } Example usage (fiction...
asked by 11.12.2015 / 12:04