Questions tagged as '.net'

2
answers

Compare properties of an object with properties of a list

I have a method: public void MetodoAleatorio(List<RequisicaoFisicaDTO> lstRequisicaoFisicaDtos) { RequisicaoFisicaDTO requisicao = lstRequisicaoFisicaDtos.FirstOrDefault(); } Where I get a DTO list and need to check if some prop...
asked by 12.07.2016 / 15:24
1
answer

How to improve comparison and string concatenation C #

I have the following code: private static string MontarDescricaoOrgaoUoUe(RequisicaoFisica requisicao) { return !string.IsNullOrEmpty(MontarNomeOrgao(requisicao)) ? MontarNomeOrgao(requisicao) : !string....
asked by 29.09.2015 / 22:12
2
answers

Check a character pattern for login

When using class Regex of C # I wanted the string nomeLogin Do not allow it to start with numbers or special characters. only allow "_" or "-" or "." as special characters. minimum of 2 characters being the first...
asked by 30.08.2015 / 21:39
2
answers

Do not display null value (01/01/0001) of a Datetime in a DataGridView

My DataGridView has some fields DateTime with value null (01/01/0001). How do I not display these values, leaving the field blank? Currently: HowIwouldlikeyoutostay: I'm using WindowsForm , C # and .Net Fra...
asked by 29.10.2014 / 11:04
1
answer

Direct printing on the door

I need a VB.Net code to print directly to the port of a bead printer without using any Windows driver . I add that my printer is connected by USB but in the future I needed it to print on any type of port: COM, Parallel, USB ...     
asked by 09.05.2014 / 10:23
3
answers

XmlDocument Exception: hexadecimal value 0x1a, is an invalid character

I have a project that reads an XML generated by another program in which I do not have access to the source code. The problem is that the generated XML comes with a special character at the end, and when I try to read XML the exception is thro...
asked by 11.02.2014 / 11:26
1
answer

Secure backup using MySQL and C #

My application is C # and BD is MySQL, when I do the backup it creates a arquivo.sql . This arquivo.sql can be edited easily in a notepad, or any other editor, thus leaving my bd well summery, how can I do that nobody edits my BD...
asked by 30.01.2015 / 21:15
2
answers

Remove objects from memory

I have DataGridView in my project and a timer refresh of 5 seconds. I realized that the system was overloading the memory, because every time I list the previous data, they remain in memory. This is the code I use to list: Using (DBE...
asked by 03.02.2015 / 12:19
2
answers

Explanation in constructor method

I have some doubts in the constructor method of a class that I'm seeing as an example, if anyone can explain thanks. private static IList<Categoria> categorias = new List<Categoria>() { new Categoria() {...
asked by 28.02.2017 / 14:41
2
answers

XML for DataTable

I've been researching how to pass the data contained in an XML to a DataTable and found the following response . Doubt: In doing this, is the theDataSet.ReadXml(theReader); method able to identify the data types in XML? Or w...
asked by 01.03.2017 / 15:14