Questions tagged as 'c#'

3
answers

Problems with result precision

I have a problem where I made a program to calculate the average of a student, where the condition is:    AVERAGE = NOTE1 + NOTE2 / 2 (the result should be> 7 for the student to be approved) The program is running fine, the problem is tha...
asked by 18.08.2017 / 01:35
3
answers

Error cast while running rest service

I'm having this error:    The 'Qtde' property on 'ItemsLib' could not be set to a   'System.Double' value. You must set this property to a non-null value   of type 'System.Single'. What can cause this? [Table("ITENSLIB")] public cla...
asked by 08.09.2017 / 19:19
2
answers

What is the error in this loop?

I want to download an .exe file from my FTP server, but it has a part in the code that is giving me trouble. Error: Invalid expression term 'while' (CS1525) Can anyone tell me what's wrong? FtpWebRequest request = (FtpWebRequest)WebReque...
asked by 10.09.2017 / 17:15
1
answer

System.IndexOutOfRangeException SQLDataReader

Hello, I'm trying to make a code read what you have in the SQL Server DataBase, but I'm getting this error: System.IndexOutOfRangeException: Pontos em System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) em System.Data...
asked by 18.09.2017 / 15:57
1
answer

Relationships with the Entity Framework?

Next, I'm modeling the domain class of a system and I'm having trouble understanding certain things of Entity Framework , so I hope you can help me by looking at what I'm following the idea of Code First : In a relationship of...
asked by 22.09.2017 / 19:47
1
answer

How to map a List to another List?

How can I map a list from one type to another list of another type? I'm getting an object list of type public List<DetalheViagem> DetalheViagems { get; set; } I need to pass the values to another list of type. public List<Deta...
asked by 22.09.2017 / 17:30
1
answer

Fill a listbox with predicatestring

I'm studying DDD and WebAPI and as I find it difficult, I'm researching and trying to solve it. Of course, sometimes I come across simple things for some here and I can not solve them right away. Sometimes I even understand what has to be don...
asked by 02.06.2017 / 15:20
1
answer

Date format C #

I need to format the date for Apr 06, 2018 . Code that I have: DateTime joinDate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Group.GetGroupJoinInfo(Group.Id)); base.WriteString(joinDate.ToString("dd/MM/yyyy"));     
asked by 06.04.2018 / 17:07
3
answers

String reading Json format for C #

Hello, I have been having several weeks to read the values of string below, I would like to read the value and in the sites it is very confusing in the search because the type json I have starts with {{ e has an object in the...
asked by 27.03.2018 / 01:08
2
answers

Bring one more field in group by linq

I have this var grupo = from item in aliquotaProduto group item by item.CFOP_ID into agrupamento select new { Categoria = agrupamento.Key, Quantidade = agrupamento.Count() }; Can I bring a ID_PROD in select besides Category and Quan...
asked by 05.04.2018 / 15:54