Questions tagged as 'c#'

1
answer

Is it possible to get a specific line of txt / csv file using an address?

Is it possible to access a line from a file txt / csv (example below) at its address directly without having to go through each line using C #?     
asked by 17.10.2014 / 20:06
3
answers

Remove list item based on property value

I have a list of objects, the objects have the following properties public class oItem { public decimal nit_codit { get; set; } ... etc } Then I have the list of objects List<oItem> PlItens = new List<oItem>(); Let'...
asked by 14.10.2014 / 15:15
1
answer

For Rotation on Axis Z

I'm new to the C # code and I'm doing a basic Z-axis rotation in Unity 3d, but I'm having a problem to stop rotating. The initial code is this: using UnityEngine; using Sysstem.Collections; public class voa : MonoBehaviour{ int vel = 150; /...
asked by 30.10.2015 / 10:55
2
answers

Differentiate DateTime.Now and DateTime.Now.Date

I have a test and would like to know when an attribute has received DateTime.Now or DateTime.Now.Date , how can I differentiate when an attribute has received these values? Note: It can be a number of values, the purpose is to kn...
asked by 22.11.2015 / 00:06
2
answers

Refresh the label without crashing the program

I need to update my label at all times when I use timer it updates, but it crashes the program Program.cs public static String Uso() { ManagementClass mc = new ManagementClass("win32_processor"); ManagementObjectColle...
asked by 11.11.2015 / 18:04
2
answers

Edit MVC with Foreign Key

I need to improve on my editLivros , then I'll explain my project. Autores ------- IdAutor Nome Livros -------- IdLivro Nome IdAutor I am registering the Authors and Books correctly, when I register the Livro , I make a View...
asked by 19.11.2015 / 19:04
2
answers

How to add an 'ul' in an 'li' HTML element via C # code?

I'm going to have a list with multiple clients, and I wanted to add those clients to a ul element of the HTML element, you have to add those clients dynamically (since each search performed on the system can bring a number of clients) via...
asked by 16.09.2015 / 22:37
3
answers

error while saving or updating with EntityFramework

I have the following method: using (var context = new ClassContexto(ClassMaster.conexao())) { using (DbContextTransaction tran = context.Database.BeginTransaction(IsolationLevel.ReadCommitted)) { try { pacie...
asked by 20.12.2017 / 13:07
2
answers

How to use SimpleInjector in a multi-layer project?

Imagine the classic architecture: ConsoleApplication (Frontend) - > Business Layer (BLL) - > Data Access Layer (DAL) That is, Frontend reference BLL that reference DAL. Note that Frontend does not know the DAL, nor should it. Give...
asked by 28.12.2017 / 22:46
2
answers

How to generate OR comparisons dynamically with LINQ?

I have a query where I should get certain values by comparing if a column is equal to a X value. X is an array that can have 1 to 4 values. How can I in my query with LINQ dynamically mount these OR ? Belo...
asked by 05.04.2017 / 17:03