Questions tagged as 'c#'

2
answers

Read Only Properties

I am working with Entity Framework. I have a class Compra , when I put a read-only property, what function does it have? Does it come as a property in memory? Is it no longer in the map that is done with the fluent api? I'm working with...
asked by 22.08.2016 / 15:38
1
answer

Query block Try Catch DO NOT execute the catch block

Good I have the following code to consult and fill a DataGridView with the query but what I try is that if the data that user indicates as a filter does not match any BD record, I execute the Catch block but it does not try {...
asked by 14.12.2018 / 20:37
1
answer

Do a modal window correctly?

I'm learning MVC in aspx, chtml y c# , and I got to the part that shows the details of a student but first I did that I copied the same structure of my Layout and now what I want is to show a modal window of Ver Detalle...
asked by 14.12.2018 / 00:55
2
answers

How to go through a datagridview and add when a code matches? C #

I need to go through a column of my DataGridView called "code" when I insert one in the textbox, if I find it simply that the column called "Captured" of the same row increases by 1, otherwise it does not do anything, it's like a supermarket box...
asked by 18.12.2018 / 02:30
1
answer

Can the KeyDown event work in the background?

I have a WPF application and I want to activate a method when pressing a specific key without the need for the form to be in the foreground, what is the possibility of that solution? Greetings! private void playSimpleSound(string url)...
asked by 27.03.2016 / 01:58
1
answer

how to execute an action when a field is empty

I have two related textbox: sub-total and discount, so that if the sub-total is greater than or equal to 500 the discount will be equal 0.10 I have the following code but when the subtotal textbox is empty the string is in the format wrong. pr...
asked by 10.12.2018 / 04:55
2
answers

Pass a parameter to the Report Viewer

Hello friends, I have a parameter of a C # method that I want to be shown in a rdlc report public static void getPerfil(){ String perfil = "ESTE ES MI PERFIL"; } I want to add it where it is in the Parameter folder to put...
asked by 19.12.2018 / 18:54
2
answers

Difference between mysqlconnection and using (mysqlconnection)?

My question is what is the difference between the following connections? Conexion Mysql without USING MySqlConnection databaseConnection = new MySqlConnection("//CADENA DE XCONEXION"); // CODE; MYSQL Connection with USING using (Npg...
asked by 19.12.2018 / 17:02
1
answer

Add columns with linq

I need to add several columns and return them in a list. But in two columns I will add adding a condition. SQL SELECT SUM(MontoInicial)AS MontoInicial, SUM(CASE WHEN TipoMovimiento = 1 THEN Ingreso END) AS Ingreso, SUM(CASE WHEN TipoMovim...
asked by 19.12.2018 / 23:28
2
answers

Validate empty fields C # [closed]

I have a project in ASP.NET where I validate the empty fields that are my textbox, what I want to do is not register the user without completing the fields and that when missing data to fill an asterisk and a message of missing data, but when fi...
asked by 23.02.2017 / 18:38