Questions tagged as 'c#'

1
answer

DateTime "Null" = 01/01/0001

How to treat a DateTime field that comes as "null" (I know that DateTime can not be null ) of a legacy base? Querying a WebService returns a DateTime field as 01/01/0001 (no value), in the case...
asked by 16.10.2015 / 05:01
1
answer

How to identify patterns in color?

I have an image and loop through each pixel of it. I need to identify the color of the pixel: - It's a light or dark color; - And the tonality of it (for example if it is bluish or reddish, greenish, etc ...). I'm using the RGB values as...
asked by 16.10.2015 / 15:29
2
answers

Format string in View

Is there any way to format a string (returned from a query) directly into View , to display the first letter of the letter and the lower case? Ex: In C # I can use the TextInfo.ToTitleCase for this. string title = "war and peace"; Tex...
asked by 04.02.2015 / 19:21
1
answer

Redirect loop explanation

I'm going to a meeting and they're going to ask why some data has a Redirect Loop. In the code, I put a false parameter and it has solved, but it turns and moves it back. The question is: What is a redirection loop? What I want is just an explan...
asked by 13.02.2015 / 18:12
1
answer

What is the difference between Task and async Task?

In the code below I wrote two methods, one with Task return and another async Task . What happens differently in the execution of these methods since for one I added in the construction the reserved word await and in the othe...
asked by 09.08.2018 / 16:53
3
answers

Error concatenating component value in query

Queries in my C # Winforms project are being done through StringBuilder . It was suggested here in the OS that I changed the way to generate the query from Consulta.Append("Select * from...") to @"select * from..." because...
asked by 31.10.2018 / 15:15
1
answer

Overloading operators in C #

I have some doubts about overloading operators in C #. What is it for? Is your concept the same as overload in Java methods? Is there a practical example of doing this on a daily basis?
asked by 07.11.2018 / 19:56
3
answers

Help with SqlQuery in context Entity Framework

I need to make a return of my database in a specific way, however I have a problem, the situation is as follows: I have this query already tested directly on SQL Server , and it is working perfectly: SELECT COUNT (ate.id) AS data,...
asked by 13.11.2018 / 16:28
1
answer

Error while trying to read excel file C #

public partial class FrmEditar : Form { private OleDbConnection _olecon; private OleDbCommand _oleCmd; private static string _arquivo = string.Empty; private string _stringConexao = string.Empty; private string _consulta;...
asked by 08.01.2017 / 21:03
1
answer

How to add an HTML element to PDF via iTextSharp?

itextsharp allows me to add your PDF elements, eg: _documento.Add(new Paragraph("Olá")); But I'd like to add some HTML elements, such as <h1> , or <p> , how can I do it? _documento.Add(????);     
asked by 22.07.2015 / 20:21