Questions tagged as 'c#'

2
answers

Should I ensure that threads end in Dispose?

Some questions about the interface IDisposable and using already exist, for example: What types of features are released in a using statement I should always use the dispose I'm still not sure what to do about threads...
asked by 07.11.2016 / 15:18
2
answers

remove mask to save to the database

I'm using MaskMoney to create a mask in the field for the user to type. wanted to remove the mask, saving only the numbers and the comma (2 decimal places) in the bank.    $ 1,300,000.00 Just saving    1300000.00 I'm using asp.net-...
asked by 13.11.2016 / 00:55
3
answers

How to convert date in dd / mm / yyyy format?

Once I published my app, I started getting the dates in American format like this: 9/14/2016 12:00:00 AM How to format for dd/MM/yyyy ? I tried convert.ToDateTime() more does not work.     
asked by 14.09.2016 / 18:11
2
answers

Reducing interface with Disposable

I saw an example implementation of a interface with Disposable which I think is redundant and would like to know if I'm right. Here is an example to illustrate: public interface IClassBase<TEntity> where TEntity : class...
asked by 04.10.2016 / 04:14
2
answers

Return Enum C #

I have the following enum: public enum TNFeInfNFeDetImpostoICMSICMS00CST { /// <remarks/> [System.Xml.Serialization.XmlEnumAttribute("00")] item00 = 00, } How do I "get" the value "00" of the enum in question? I alr...
asked by 20.09.2016 / 14:33
3
answers

How to make a max + 1 with lambda or linq but with tables from nothing, all null

I made this method and other attempts. With the table filled, okay, but with the table without data, it is giving error: public int GeraIdBalanca() { int chave = 0; var obj = contexto.Balancas.Max().IdBalanca; if (obj == 0)...
asked by 17.08.2017 / 15:43
3
answers

Error in using if

My intention with this code is to show how many numbers are odd and how many are even. (eg: Odd: 3 Par: 2). for (int i = 0; i < 6;i++) { int SePar, SeImpar, cont; SePar = 0; SeImpar = 0; cont = 0;...
asked by 22.08.2017 / 03:50
2
answers

Error trying to deserialize JSON from a webpage

I'm using Luis.ai to create my neural network of intents and the Microsoft Bot Framework to create my chatbot, but I can not read a json that Luis is generating for me. Luis's class: public static async Task<LuisResult> GetResponse(st...
asked by 27.08.2017 / 04:04
2
answers

Generate text file from an application console application

I need to tailor this method of an application Windows Forms link to Console Application , that is, instead of using the object saveFileDialog.ShowDialog() I have to create the file using another method of class Stream...
asked by 10.03.2016 / 01:41
1
answer

ASP.Net and C # - automatic email sending

In the site that I assumed from a client, developed in ASP.Net with C #, there are registered employees with a defined admission date. The registry of these developers is in a SQL Server 2008 database table. I needed to create something (mayb...
asked by 26.07.2016 / 19:38