Questions tagged as '.net'

2
answers

Get a specific value in an array

I'm trying to get only the name of an element from an array . I want to get the name of the first element of the array and also the name of the last element. I put my method in class Carreira public override string ToString() {...
asked by 06.03.2017 / 16:33
2
answers

Loop for ATM

I need to run this code until the user prompts to exit. In the case, it will inform the result at the end and follow with a question to the user if he wants to continue using, hence the code executes again until the user exits. namespace Ca...
asked by 15.09.2017 / 22:45
1
answer

Are there online programming learning environments with hands-on exercises and challenges for C #?

There are a few sites, such as URI Online Judge , which allow programmers to practice programming and share knowledge through specific exercises and logical and mathematical challenges. But some are restricted in language. The one mentioned...
asked by 22.11.2014 / 00:53
3
answers

Problem with Build in release mode C #

When attempting to build release mode release displays the following error message:    The mixed-mode assembly has been compiled against the runtime version 'v2.0.50727' and can not be loaded at runtime 4.0 without additional configuration in...
asked by 24.04.2015 / 16:17
2
answers

How to convert text in file to number with decimal places?

I have this data written in the text file "000001010" (it only has this data), but I wanted it when it was for the variable to be 10.10. I'm reading the data from the file like this: var linhas = System.IO.File.ReadAllLines(@"C:\teste\pedro...
asked by 23.10.2017 / 17:04
2
answers

Unhandled exception (0-based index)

My idea is to make a small registration and I'm testing this for later adding that data to a DB. The problem occurs at line Console.Write("\nGenero do disco : {1}", genero); , at the time of displaying the string read via keyboard. Here...
asked by 09.07.2017 / 04:31
4
answers

Conversion of list of interfaces in object list: (ListInterface in ListObject)

I need to convert a IList<Interface> to a List<Objeto> . See the example: public interface IObjetosBase { IList<IObjetosBase> get(); } public class ObjetosBase : IObjetosBase { public virtual IList&l...
asked by 22.07.2017 / 14:33
2
answers

How to Read and Convert .xsd Extension File to a C # Class

How to Read and Convert .xsd Extension File to a C # Class In order to do this and convert the site schema to make it possible to generate an xml with correct schema to be able to issue NFE.     
asked by 04.07.2017 / 19:05
2
answers

Random Query List Linq to Entity C # [duplicate]

I would like to get a list of 3 objects within a query Link. var listaPessoas = from i in this.Context.CreateObjectSet<listaPessoas>() select i; ... listaPessoas = listaPessoas .Where(x => x.Nome.Contains(filtro.Nome); ......
asked by 31.08.2017 / 15:28
2
answers

FirstOrDefault, SingleOrDefault, ElementAtOrDefault [duplicate]

What is the difference between elements FirstOrDefault and First , SingleOrDefault and Single or ElementAtOrDefault or ElementAt . When to use with and without Default ?     
asked by 19.09.2017 / 16:47