Questions tagged as 'c#'

2
answers

Change the Context according to the application

I need the web part to point out which context the system will use. My project is divided as follows: AftercompletingitIhadto"replica it", but using another bank. The tables are the same does not change anything, but it is in another bank...
asked by 02.07.2014 / 17:22
1
answer

Set a default comment for every new project

I need to set a default comment, so that in every project that is created it appears, without typing it every time. Ex: \ Author: Peter H.     
asked by 27.08.2016 / 23:27
1
answer

What are the differences between the following casts and when to use each one?

   Casting   [...] process where one type of object is explicitly converted to another type, if conversion is allowed. Source: > Stack overflow in Portuguese Assuming the following situation: var i = 10 What are the di...
asked by 09.09.2016 / 00:51
1
answer

Silent installation of Postgres and creation of the base in installer

How can I embed the PostgreSQL database in my WinForms system installer? I can even put it as a prerequisite to install before the system binaries, however, I wanted to do a silent installation. I would also like to know how to create the ban...
asked by 22.09.2016 / 14:54
3
answers

What is the best way to save a Group object that has lists of Items?

I have a registration and there are several links, for example: public class Grupo { public string Nome {get;set;} public List<GrupoItemA> ItensA {get;set;} public List<GrupoItemB> ItensB {get;set;} public List<Grupo...
asked by 25.09.2014 / 14:25
2
answers

Create Static SelectList and pass a selected item to View

I have a question about how to send my selectList "status" to my View EditarUsuario . I've created my list with the following items: var list = new SelectList(new[] { new{ID="2",Name="Selecione"}, new{ID="1",Name="A...
asked by 02.10.2015 / 22:42
2
answers

How to receive the various fields of a view in the controller

I need to create an Insert from multiple fields at the same time! My system has multiple table and relationships and I am having difficulties at that point. I have this registration screen: Withthiscode:@using(Html.BeginForm()){<divstyle="wi...
asked by 15.10.2015 / 00:10
1
answer

List of Entity Framework attributes for entity mapping

For my Database to be outside the EF convention, and as another system already developed uses it, it is out of the question to change table / column names. I would like to know the available attributes (ex: [Key] , [ForeignKey] )...
asked by 19.10.2015 / 17:46
1
answer

How to put a background image and make it responsive?

I'm learning C #, so I'd like to know how to put a background image (and / or> background) and also remove the blue borders. I'm using Visual Studio. Ps : Some videos I saw on YouTube basically boiled into the properties of form and s...
asked by 09.05.2017 / 17:09
1
answer

How to calculate the time of a LINQ query?

I have a table with + - 900mil records. I make some queries using where clauses and I want to see the time difference between them. How do I display the time in label at the end of the query?     
asked by 12.05.2017 / 05:42