Questions tagged as 'c#'

2
answers

Find phone numbers within a txt file

How can I list .txt files that contain phone numbers in this format (99) 99999-9999 cell and (99 ) 9999-9999 fixed ? This is the code that I have done so far, you just need to find the string in the format of a phone within the .txt fi...
asked by 25.07.2018 / 00:52
2
answers

Consider null and empty strings as equivalent

I want to compare strings that come from two different sources. If they are different, I will do something. More or less like this: if (foo != bar) { noop(); } However, in my specific case, I am considering that an empty string and a nu...
asked by 12.06.2014 / 19:46
2
answers

Recover data redirectaction mvc c #

I have a student consultation, // POST: /Admin/Anuncio [HttpPost] public ActionResult Index(Estudante estudante) { if (ModelState.IsValid) { List<EstudantesEncontrados> list = GetEstudante(GetEstud...
asked by 28.05.2014 / 07:33
3
answers

How to correctly traverse all items in a checkedListBox C #?

I have a checkedListBox in a form's tabControl. In the checkedlListBox there are several items that can be selected. When the user clicks the button below the checkedListBox, a loop is thrown that checks to see if it has selected items or not...
asked by 17.02.2017 / 17:28
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
1
answer

Get data return xml

I'm trying to return the data from this xml: <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <GerarNfseResposta xmlns="http://www.betha.com.br/e-nota-contribuinte-ws"> <ListaMensagemRetorno> <Mensa...
asked by 18.12.2018 / 13:48
2
answers

Low Performance When Querying DataTable C # - Plan Coded Ui Test

I have a performance problem when querying the numbers of a DataTable-X with a DataTable-Y , I have to check if the DataTable-X number exists in DataTable-Y (and if I find it complements DataTable-X with data fr...
asked by 31.12.2018 / 13:05
1
answer

How to concatenate fields in linq and rename

I made a linq and it is not working the concatenation and the rename of it. See: var monta_arvore = (from rup in db.Ruptura from apr in db.Apresentacao.Where(ap => ap.Codigo_Apresentacao == rup.Codigo_Apres...
asked by 09.09.2014 / 21:38
1
answer

I can not fill an array

When I put fixed values in the array size I can fill it up, but when I try to capture the values in arrays a message like this appears:    The index was outside the bounds of the array ' int a = 0, b = 0; double[ , ] test = n...
asked by 13.10.2018 / 16:43