Questions tagged as '.net'

2
answers

Serialization of a large list in JSON.Net

I have a problem with the serialization of an object (a list of a class with approximately 5000 items). I am using JSON.NET to generate the Json string but it is getting the following problem, in the middle of it is a text like this: ,{"Sta...
asked by 23.12.2015 / 14:35
2
answers

How to break lines (console mode)?

As I break lines in C #, type if I for two commands Write the console will print them side by side, how do I print on the bottom line. Ps: Code below var A1 = Console.ReadLine(); var A2 = Console.ReadLine(); v...
asked by 16.02.2017 / 09:27
2
answers

Deleted file deletion in C #

I'm using the following line to create and write: File.WriteAllText(caminho + cliente, xml); In it I record an XML and then I treat it as follows: if (File.Exists(caminho + cliente)) { XmlTextReader xmlLer = ne...
asked by 06.10.2016 / 22:05
0
answers

Error importing NFSe Service from Aracaju

I'm trying to add this service in VS 2013: https://www3.webiss.com.br/aracajuse_wsnfse/NfseServices.svc But you can not add this URL as a service. Usually the URLs I add do not have .svc at the end. Error:    There was an er...
asked by 04.03.2015 / 14:01
3
answers

Problem with PadLeft [duplicate]

I have a problem using the PadLeft method. I need to put some zeros in front of a string, but I can not. For example: string value = "2001795"; string newValue = value.PadLeft(5, '0'); Theoretically, the string "newValue" should be set to...
asked by 24.02.2017 / 13:40
2
answers

Using IEnumerable

I saw an example in another post about using IEnumerable var ent = new EntFuncionarios(); IEnumerable<Funcionario> funcionario = ent.Funcionarios; IEnumerable<Funcionario> temp = funcionario.Where(x => x.FuncID == 2).ToL...
asked by 20.11.2014 / 19:45
2
answers

Treat return in class in C #

I have a Mesa class: public class Mesa { public int Cdmesa { get; set; } public int Flsituacao { get; set; } public string Status { get; set; } } I would like to return the Status with the following conditions:    If S...
asked by 28.10.2016 / 17:39
3
answers

Retrieve MAX value from an SQL column

string var = ""; SqlConnection con = new SqlConnection(Banco._strCon); string sql = "select max(end_id) from endereco"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if...
asked by 27.10.2015 / 16:26
2
answers

Start Windows Forms program in the background

I developed a monitoring application using Windows Forms, but it does not need to have anything visual at the moment, so I'd like it to run when it runs in the background (I'd like the icon to stay where the icons are viruses, etc.). I do not...
asked by 01.08.2017 / 16:17
2
answers

Remove a quantity N of days on a date

How can I remove a quantity of N days on a date? Example: namespace TesteData { class Program { static void Main(string[] args) { var dataAtual = DateTime.Now.Date; // dataAtual 13/09/17 var qtdDias = 5;...
asked by 13.09.2017 / 22:25