Questions tagged as 'c#'

2
answers

EF relationship

I know it's something basic, but how do I make a relationship between Entities using the Entity Framework? I have the Contest table and the StatusContacts. The Contest table must have an associated status (Normal, Canceled and etc.). Below...
asked by 16.12.2016 / 19:49
1
answer

Could not load file or assembly 'EntityFramework, Version = 5.0.0.0 or one of its dependencies

I would like to know if someone could help me with this error, as I am trying to enable Migrations in a project and this error appears at the time of giving the enable-migrations command in the manager console of visual studio packages....
asked by 21.01.2017 / 00:19
1
answer

Problem displaying one form inside another

I'm having trouble displaying one form inside another through a panel. The issue is that by modifying the state of the main form from WindowState == FormWindowState.Normal to WindowState == FormWindowState.Maximized , the form opene...
asked by 21.01.2017 / 16:28
2
answers

AD Group Restrictions

I am currently developing a WebAPP where I have already been able to have the login confirm the credentials of the user in AD. Basically the login already works correctly. My goal now is to create 1 group in AD and specify that only those in...
asked by 03.02.2017 / 12:20
1
answer

How to return warning in a View if there is no data to display?

I've created the code below that generates a list. The same check whether the list contains any data recorded in it or not. If it has data, it returns a View with the list inside, if it does not have data, it returns null . How to do, i...
asked by 22.06.2017 / 22:53
1
answer

Error in parameter constructor name ObjectParameter C #

When I pass a string variable to the ObjetParameter parameter it gives the following error. string nomeParameter = sql.Substring(startPosition, stopPosition - startPosition); ObjectParameter parameter = new ObjectParameter(nomeParameter...
asked by 23.06.2017 / 21:03
1
answer

Perform database mapping for DbSetT.SqlQuery ()

Error while executing SqlQuery from my DbSet.    There is no mapping of the System.Data.Entity.Core.Objects.ObjectParameter object type to a native type managed provider. I would like to leave my generic database, so I put the parameters...
asked by 23.06.2017 / 22:07
1
answer

There is no ViewData item of type 'IEnumerable' that has the key

I'm having a problem with the Employee Position that stays in a separate Table, when I try to create an employee selecting the position, it's the error ... but if I assign the position in the Controller (Ex: official.CargoID = 1) it works normal...
asked by 15.11.2016 / 23:53
1
answer

Find information in the database in one row of SQL code per logged-in user

I've been able to fetch all dates from the database. However, I would like to search through a specific ID that is logged into the system. Per session, in case. But this code is giving error in the part where I put the HttpContext. Any suggestio...
asked by 19.11.2016 / 17:56
1
answer

Set Value in an @ html.DropDownList

In a form for Address Book, I wanted to do the following. the guy types the zip, then fetches the zip, and returns the data to fill in the EditorFor. So good, it's working. City and States are in a separate table, and are displayed by DropDownLi...
asked by 18.11.2016 / 14:33