Questions tagged as 'c#'

1
answer

Use DefaultIfEmpty in a LINQ query with Join

The purpose is to join these two lists, and if in the pr list you have an item that does not match the un list, the default value is returned. I know there are other ways, however, I'd like a solution using DefaultIfEmpty...
asked by 04.01.2016 / 01:38
2
answers

Pick values from a dynamic list

I have a list of type dynamic : private List<dynamic> listServicos = new List<dynamic>(); And it's being populated like this: listServicos.Add(new { Codigo = txtCodServico.Text, Servico = txtNomeServico.Text, Quantidade...
asked by 28.12.2015 / 16:37
3
answers

SQLSERVER ERROR in C # application

I have a problem with the SQLSERVER database. I try to connect from a point to the server and the error appears:    Network-specific or instance-specific error when connecting to   SQL Server. The server was not found or was not accessible...
asked by 01.07.2015 / 16:11
1
answer

Sending a message to a local network in the broadcast style via UDP

I made a question about P2P connection , then with one of the answers came the question: How to send a message on a local network via UDP in the broadcast style, without a specific recipient? With this I would like the following solutions:...
asked by 24.06.2015 / 23:06
1
answer

Code First Migrations MySQL - Specify the '-Verbose' flag to view the SQL statements being applied to the target database

I'm creating a Web application in C # and for the sake of the hosting server, the database is in MySql. So I installed MySql.Data.Entity, EF6, I activated Migrations, added the class Migrations, but at the time of giving Update-database -Verb...
asked by 03.07.2015 / 07:42
3
answers

Suffix and Prefix of a string. Pick up piece that serves both

I need to do a function that returns the Length of a part of the string that is both suffix and prefix. So: Given the string: abbabba, the answer would be 4, because that would be it: Prefix: a ab abb abba abbab abbabb Suffix: a ba bb...
asked by 29.06.2015 / 22:31
2
answers

Read specific text inside a .txt in C #

I need to read a text file that contains several lines: 1 C0000000000 132008281 06140214 080515 0000000005990 00000000000000000000000000000000000599000000000000000...
asked by 29.05.2015 / 15:48
1
answer

How to Duplicate Values from an ArrayList

I would like to know how I can separate values that show duplicity, an example: I have a% Variable with% set to FormaPagto , In this variable I have 6 data:    0 - Money 1 - Debt 2 - Debt 3 - Money 4 - Money 5 -   Check What I...
asked by 28.05.2015 / 15:42
1
answer

Metadata Include - MVC - working with insertion of data into two tables

I have two classes: User UsuarioP where Usuario has its id (PK) and UsuarioP has id (FK) of Usuario . I'm working on ASP.NET MVC 4 using Fluent API. The classes are mapped inside the project t...
asked by 27.09.2015 / 22:50
1
answer

Query Linq with count

I am making a query that has some joins and a count, however I want to do it with Linq . This is my Query. sbSQL.Append("SELECT grproj.cdgruproj as Id, grproj.dsgruproj as DescricaoGrupoProjeto, "); sbSQL.Append("(SELECT...
asked by 06.04.2015 / 16:31