Questions tagged as 'c#'

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
1
answer

Implementing the concept of database inheritance

Why is not the PessoaJuridicaId attribute generated? This is the base class Pessoa : public class Pessoa { public Pessoa() { DataCadastro = DateTime.Now; } public int PessoaId { get; set; } public Da...
asked by 01.08.2017 / 14:04
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 model the products table for an e-commerce?

I'm having a question about how to model the Produto table of a small e-commerce I'm doing. I've been seeing some e-commerces and I came across the following situation: mm same product can have different colors and sizes, so when the cust...
asked by 23.08.2017 / 14:28
3
answers

Get the highest value from a list? [closed]

I need to generate 100 random values, save in a list ( List<> ) and get the largest number. How do I get as many as I can?     
asked by 18.08.2017 / 02:54
2
answers

Fill List with return from sql

Good morning How do I populate a list with a return from an sql? What I tried to do for sure will give me an outofrange exception List<string> list = new List<string>(); string query = "select * from pedidos_distribuidos"; st...
asked by 20.07.2018 / 15:20
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
3
answers

Function Jquery can not find the Controller when I go to the server

During the development the function below finds the Control and makes the request correctly, however after publishing on the server the function no longer finds the Controller: During development I have to leave it like this: url: "/Contr...
asked by 22.06.2017 / 16:33
2
answers

How do I INNER JOIN in this case?

I am a beginner in PostgreSQL and I need to make a INNER JOIN to relate data from two tables. It took me a long time to figure this out from FOREIGN KEY , but I made the right reference in the database. Now, I have a C # application...
asked by 10.06.2017 / 01:04