Questions tagged as 'c#'

1
answer

Form running after closed

I have an application with a Form1 , where my pictureBox is. I added another Form2 to the project that when executing it it turns a magnifying glass, so, to use it on top of the first Form1 . My problem is: after pressing ESC which is...
asked by 16.08.2017 / 20:59
1
answer

How to delete rows from a datagridview

I'm developing a C # program and would like to know how I can block / delete a sql row in datagridview . The line I wanted to delete / block is the last one that is selected in print, I wanted to know if it is possible to block or delete b...
asked by 21.08.2017 / 13:15
1
answer

How to configure AutoMapper in a WindowsForm project?

How do I configure AutoMapper in a Windows Forms App, where: Which file should I configure to load with the application and be available? How to use with a simple example?
asked by 10.11.2017 / 14:39
1
answer

How to serialize a color with Json?

I have the following code, in which I am trying to serialize and deserialize a class that has 2 variables Color : static void Main(string[] args) { Color cor = Color.FromArgb(255, 255, 0, 0); Color cor2 = Color.FromArgb(255, 0, 0...
asked by 20.08.2017 / 17:57
1
answer

A problem to solve with lambdas expressions

I did this to return a list. It happens that it gives error, saying that it has no way to transform an anonymous expression in the past type (object). public List<Liberacao> PegaLiberacao() { var lista = contexto.Libe...
asked by 22.08.2017 / 00:59
1
answer

C #: How to identify worksheet title

Hi, I'm working on an excel-to-txt converter and I've been trying to make an algorithm where it detects the column title and returns an error if the column had the same title, to identify only the title? In this algorithm it only compares the...
asked by 03.07.2017 / 17:34
1
answer

C # - Use form data in IF

I'm trying to retrieve data from the form and need to use it in an IF. protected void btnSubmit_Click(object sender, EventArgs e) { try { if (txtLocalizacao.Text != "") { conn.Open(); SqlCommand...
asked by 30.06.2017 / 21:19
2
answers

Inheritance in Entity Framework

I have the following structure: Table:    Services (Services table) - with the common properties of all services + Type + ServiceID Table:    Service 1 (Service table1) - with service 1 properties Table:    Service 2 (Service...
asked by 29.06.2017 / 23:44
1
answer

RegEx in JavaScript and C # for text validation

In a Asp.Net WebForms plication application, I have a TextBox that I need to validate if it contains any excerpt where < is followed by any character except whitespace. For example: Nesse texto pode existir < com esp...
asked by 25.05.2017 / 21:47
1
answer

TimeSpan Conversion

I'm reading a file delimited by a semicolon and one of the information that is the duration of the link is coming as "00:97:54". When trying to convert to TimeSpan, it obviously gives error    The TimeSpan could not be parsed because at le...
asked by 19.05.2017 / 18:31