Questions tagged as 'c#'

1
answer

Instances and variables in C #

In C # when you create a variable you create a value of a certain type, for example a bool can only receive true or false , a int integers and so on ... I wanted to know how these values would be classified, true...
asked by 24.10.2018 / 17:46
1
answer

Lambda doubt in one type

How do I make a lambda to bring only records containing the word Transfer? For example, in my example, there are 19 records, but 3 are not Transfers, so it should be 16. Below my code and my wrong lambda. OfferV2[] traslado = ((OfferV2[])Sessa...
asked by 14.04.2014 / 18:17
1
answer

Read data from a column through C # [closed]

I have a postal code and divided it into 2 variables: the first, where the first 4 numbers appear and the second one where the last 3 appear. Ex:    4300-234 - first = 4300 ; second = 234 . I have a table in the database that has 3 c...
asked by 18.04.2017 / 17:47
1
answer

How to read attributes of a row in XML?

I have an XML file with the following structure: <?xml version="1.0" encoding="ISO-8859-1"?> <FIELDS> <FIELD attrname="CO_UNIDADE" fieldtype="string" WIDTH="31"/> <FIELD attrname="NO_FANTASIA" fieldtype="string" WI...
asked by 12.05.2017 / 18:34
1
answer

How to read text files? [duplicate]

I want to read the rows from a file and then add them to a ListBox. public void subroutine() { string linha; try { using (StreamReader read = new StreamReader(Application.StartupPath + "workers.txt",...
asked by 22.06.2017 / 14:02
2
answers

How to iterate in a C # model with variables that have number?

I have a model that was made by another developer where it has several fields like this: . . . Teste() teste = new Teste(); teste.campo_1 = 1; teste.campo_2 = 2; teste.campo_3 = 3; teste.campo_4 = 4; teste.campo_5 = 5; How would you fill...
asked by 16.01.2018 / 18:51
1
answer

Entity Framework does not edit FK

I have some difficulties with a large project, and I tried to do a simple replica to post here so that someone can help me. One of the difficulties I'm having and how to edit foreign key fields (FK). I have three entities: Vehicle, Make and Mode...
asked by 19.11.2015 / 20:48
1
answer

c # cmd if you type something else it shows a msg

Hello, I would like to know how I could do in cmd so that when someone writes something other than tree, a msg says "what you wrote" was not recognized ...     
asked by 26.07.2016 / 23:58
1
answer

lambda expression gives conversion error

This is my linq with lambda: public JsonResult CarregaDescricaoRede(string _tipo_rede, string _uf, string _cidade) { var resultado_rede_descricao = (from _pdv in db.PDV .Where(r =...
asked by 30.09.2014 / 16:26
1
answer

How to read this text and separate the names of each person using Artificial Intelligence?

I have this text, I would like to read the names of each of the players. What would be the best way to read it? Is there any tool / language or extension for C # that will allow me to read this structure? Not a Regex, but something like the conc...
asked by 15.05.2014 / 23:44