Questions tagged as 'c#'

4
answers

The input string was not in an incorrect format.

Hello, I'm a beginner in programming and I'm trying to show the user how much RAM is being consumed at the moment, I'm using the following code which is not pointing nor an error compiling only when I give Start it says:   An unhandled excepti...
asked by 12.11.2015 / 18:57
4
answers

Is it a bad practice to make this comparison?

To compare two values with a single, I can do as in the example: if(foo == "abc" || foo == "54") { ... } But as I need to add more conditions, this gets tricky: if(foo == "abc" || foo == "54" || foo == "23A" || foo == "3xe" || foo == "123...
asked by 25.09.2017 / 18:43
4
answers

What would be the best way to do a CRUD for a framework in the most generic way possible?

I am studying to do a CRUD for a framework but I am trying some problems to be able to do this in the most generic way possible. For example: I have a class Pessoa() I want to do CRUD passing only the Person object to another class...
asked by 05.02.2014 / 21:04
1
answer

Failed to recover factory COM class CLSID

I developed an application on my pc that does the following: from an upload of a word document, it generates a new document with some basic information. To generate this information, it opens the template document, finds a tag that exists in tha...
asked by 13.03.2015 / 21:13
4
answers

Merge word docx documents from a template and replace words

I need to get the contents of a docx file like template , which contains as text content and some identifiers to be changed with other data , and from that template create a single docx with the same content but replicated and with cha...
asked by 01.06.2014 / 21:33
4
answers

How to create a variable where access its properties via string?

I would like to access by string the properties of an object: (EXAMPLE 1) var cor = casa["cor"]; var tamanho = casa["tamanho"]; Instead of access like this: (EXAMPLE 2) var cor = casa.cor; var tamanho = casa.tamanho; Creating this wa...
asked by 13.10.2015 / 18:42
5
answers

What is sealed in C #?

I saw a class in C # that was declared like this, in an answer I read in SOen: public sealed class Link { // Resto do código } What is the keyword sealed in the above case?     
asked by 14.06.2018 / 19:54
5
answers

How do I make child form values in parent form C #?

I have a C # signup. There is a "search street" button that opens a form search child. When you run the search, it displays the result in the datagrid of that form child. I would like the event cell_click of the datagrid to comple...
asked by 30.01.2014 / 12:31
3
answers

Generic class property

I have a class with two properties ( Name and Value ). The property Name is a string , already the property Value want to leave the type variable. public class Field<TValue> { public string Name { get...
asked by 27.09.2017 / 19:11
2
answers

Read the entire contents of a text file

I need to read the entire contents of a text file and put it in a string . Generally, I do this: using(var reader = new StreamReader("arquivo.txt")) { var strBuilder = new StringBuilder(); while (objReader.ReadLine() != null)...
asked by 15.10.2015 / 19:22