Questions tagged as 'c#'

7
answers

How to use multiple SQL statements (in the delete case in ORACLE) on a single line in C #?

I made a command because of foreign keys, just to plug hole, but it is not working because of an invalid character error, I believe it is ";" . I know I'm doing this the wrong way, so I accept suggestions for a more appropriate code. At...
asked by 05.02.2014 / 14:11
1
answer

Auto Relationship in EF

I'm having the following problem when creating two auto relationships. When you run the Update-Database the following error message appears:    Unable to determine the main end of an association between the   types 'Autorelação.Franquia'...
asked by 28.07.2016 / 15:49
2
answers

Export charts from an Excel worksheet without Interop

I need to read and write data from Excel spreadsheets, and export some graphics, using C #. But I can not use the interop library ( Microsoft.Office.Interop ) for this. How can I do it? Does anyone have any nuGet package indication for...
asked by 03.12.2018 / 15:14
2
answers

Filter items that do not contain words in my list

I have a personal: List<Grupos> lista = new List<Grupos>(); And I have this code var txtFiltro = "noivas,unhas"; var palavrasFiltro = txtFiltro.ToLower().Split(','); matches = lista.Where(x => !palavrasFiltro.Contains(...
asked by 12.05.2016 / 16:50
2
answers

EF6 + PostGresql - 22021: invalid byte sequence for encoding \ "UTF8 \": 0xc9 0x52

I am trying to get data from a PostGreSql database with SQL_ASCII Enconding, however in some records I get the error message 22021: invalid byte sequence for encoding \ "UTF8 \": 0xc9 0x52 " / p> I have tried to set the Enconding in the conne...
asked by 04.06.2016 / 22:10
2
answers

Sort DateTime field only by Date part

I have a property of an entity that is of type DateTime? and in SQL Server it is of type datetime also. I need to make a query that sort by date, but without considering the time, because in that specific view will not show the tim...
asked by 22.12.2016 / 18:00
2
answers

How is the generated query created in Linq when we do UPDATE?

How is the generated query created in Linq when we do UPDATE? using ColWebDBContext.DBase.Banco; using System; using System.Web.UI; using System.Linq; namespace DBContext { public partial class _Default : Page { protected void...
asked by 28.10.2016 / 20:24
1
answer

DataAnnotations for checking between Start Time and End Time

I have two fields of type [DataType (DataType.Time)], being the Start Date and End Date, and I can not let the user enter the Final Date smaller than the Start Date for the purpose of calculating hours worked. p> How do I compare two time fiel...
asked by 23.12.2016 / 18:09
2
answers

Simplify LINQ Query with Contains

I have two questions regarding LINQ queries below: { //lista de itens do orçamento var ids = itensOrcamento.Select(p => p.Id); //Produtos - todos produtos cadastrados var produtos = Produtos.Where(p => ids.Contains(p...
asked by 31.12.2015 / 21:36
2
answers

Which pattern is used to validate business rule?

I use repository patterns for search, save, and delete I would like to know where the validation of my business is best ... For example: I need to check that item is in contrato of prestador , and invoice it with the...
asked by 12.06.2014 / 14:51