Questions tagged as 'c#'

1
answer

System.Collections.Generic.IEnumerable

Help, guys! I have tried to do everything, already includes "using System.Linq" and nothing. Anybody know? MedicosController using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Ca...
asked by 28.03.2018 / 21:21
1
answer

wcf c # directory access error

I am writing a WCF service using C #. In one of my methods I try to access a directory on the network (any command like directory.Exists() or directory.GetFiles() ) and I get the following error:    System.ServiceModel.FaultExc...
asked by 28.03.2018 / 22:30
1
answer

Error in expression

Can anyone help me with the following error? Here is my code below. I'm trying to fix this error, but I did not succeed. public IEnumerable<Dia1> GetPendenciasByUser(int centroId) { var query = Db.Dia1S .Join(Db.Cada...
asked by 22.03.2018 / 15:15
4
answers

Fill in a datatable from a txt

I have a datareader writing directly to the text file, int count = dataReader.FieldCount; while (dataReader.Read()) { for (int i = 0; i < count; i++) {...
asked by 22.03.2018 / 17:03
1
answer

Shorten / Camouflage too large text within a grid

I have this line of the grid that takes the description of a message, however it is very large and sometimes it breaks the layout of the grid, I would like to know if it is possible to shorten the message and / or camouflage the message in a lin...
asked by 10.05.2018 / 23:26
1
answer

Error {"The object reference was not defined as an instance of an object."} System.NullReferenceException MVC ASP.NET

Well, it gave me an error on the main page so I tried to pass the values from the search to the index. the error gives in line 35 of the index of the main page with the code:       @foreach (var item in Model) I'm doing a movie sales store, and...
asked by 12.05.2018 / 00:29
1
answer

Asp.Net MVC binding view model with a List

I'm trying to make a binding of my view, but when action is called my ViewModel queue comes with the ViewViewModel.Validates to null. I've tried it with    @Html.Hidden ("Code", validator.Code) , but it's not going. My view....
asked by 17.04.2018 / 15:42
1
answer

Error: Must declare the scalar variable

Can anyone help me with this? Must declare the scalar variable "@hospitalId". PendingController: public async Task<ActionResult> Index() { if (!Cookies.Exists("hid")) return RedirectToAction("Index", "Login", new { are...
asked by 22.03.2018 / 21:53
1
answer

Listing based on query in bank

First of all, I apologize if the question is vague, since it is a very broad topic. Today I have a system of registration and consultation of students, where the query is made exclusively by CPF, since it is a unique identifier and a constrai...
asked by 23.03.2018 / 19:07
1
answer

Event when key pressed 2 times

I have the following event: private void TelaAcao_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue.Equals(27)) { this.Close(); } } The result of this is that every time I press ESC...
asked by 23.03.2018 / 15:29