Questions tagged as '.net'

1
answer

Accessing MySQL with C #

I am creating a simple Form that has 3 TextBoxes and 3 buttons and I want to save the information entered in Textboxes in a table. I have already created querys all within a class acessoBD , but I can not acc...
asked by 24.09.2015 / 03:00
2
answers

Where to put Data Annotation? View Model or Model?

Using Entity Framework Code First, with view model and model . To create a column with varchar(2) , I need to put MaxLength(2) in model and view model ?     
asked by 28.08.2015 / 21:32
3
answers

How to send 2 Controller objects to the View in C # ASP.Net MVC?

I made a query in the database in 2 tables and saved in 2 objects in the controller , but I can only send 1 object to view . // Controller // Pego os dados do BD e salvo no objeto var objPessoa = new PessoaAplic(); var dadosPessoa = objPesso...
asked by 06.10.2015 / 21:22
2
answers

What is @ in a view and controller?

I program in PHP and am starting to learn how to program in C # ASP.Net MVC, however I have some questions: What is the @ (arroba) serving in both the controller and the view ? What is the purpose of these { get; set; } calls th...
asked by 05.10.2015 / 18:06
3
answers

Initialize private fields in declaration or constructor?

I'm modeling a class that has a private list and an internal dependency to another object: public class Teste { private IList<string> Textos; private Teste2 Teste2; } I can initialize them in the declaration: private IList&l...
asked by 14.04.2017 / 02:59
3
answers

Why methods that operate pointers are insecure in .NET?

Reading a little of the .NET source code I noticed that some methods have a peculiar modifier, the unsafe . [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.CompilerServices.FriendAccessAllowed] internal unsafe s...
asked by 09.10.2017 / 21:15
2
answers

Is there an equivalent to AndAlso and OrElse in C #?

In VB.NET there are two interesting operators: AndAlso and OrElse . When used, the logical expression is not fully evaluated at once. See the following example: If (Not Usuario Is Nothing) And (Usuario.Idade = 18) Then ... E...
asked by 27.07.2017 / 13:52
2
answers

What are the differences between background and foreground threads?

What are the differences between these two types of threads and foreground ?     
asked by 17.09.2014 / 21:36
2
answers

Get user-created methods

I have a method that lists the methods that a given object has, I want to take only the methods created by the user, in this case: Add and Subtract What this method returns me: GenericClasspublicclassGenerico{publicobjectObjeto{get;set;}pu...
asked by 07.05.2014 / 22:43
1
answer

How to compile the database to install together with a C # application?

I'm developing a C # application, and I need to know if I can build the database to install with the application, I've already seen something here about SQLite, but I do not know the tool and I do not know if it stores images, my case will have...
asked by 18.12.2015 / 06:25