Questions tagged as 'c#'

2
answers

Display data from a DataGridView column in float

I'm developing an application in Windows C # which takes the order inside a datagridview and when you press the "calculate total" button you have to add the "Cost" column. The problem is that I do not respect the decimals since it shows the whol...
asked by 12.09.2018 / 20:49
1
answer

C # Threads error the process can not access the file because that being used in another process

I am working on C # with threads but I can not print them in a txt because the error occurs:    The process can not access the file   'C: \ Users \ wuesi \ Desktop \ Data.txt' because it is being used in   another process System.IO.IOExceptio...
asked by 03.06.2018 / 00:20
1
answer

Extract part of a chain between two specific points

Recently I found myself needing to extract all the values that are between two specified points of a chain, in this case everything that is inside the parentheses "()" . What would be the most optimal way to do this? string cadena =...
asked by 11.06.2018 / 16:59
2
answers

How do events in C # trigger?

Passing through EVENTS and DELEGATES in C #, I find the Click event in almost all the controls, I want to make a personalized event, I have tried to see the definition of the "CLICK" event. I understand that the next line invokes the delegate an...
asked by 11.07.2018 / 16:37
1
answer

SQL + C # Variable value Null or NULL?

Good morning. I have an ASP.NET C # application and in a WebForm I must insert data in a table. For this, create a stored procedure and you can insert null data: CREATE PROCEDURE [Insertar_Tabla] @var1 INT=NULL, @var2 VARCHAR(10)=NULL...
asked by 30.06.2017 / 20:30
3
answers

Go back to the Main

This is my main that already includes a flag to leave the program (follow): static void Main(string[] args) { string[] nombre; int opcion, tope = 0, cantidad; bool seguir = true; Console.WriteLine("Ingrese la cantidad: "); canti...
asked by 30.06.2017 / 17:30
3
answers

Improve Performance Nested Foreachs

I have 2 foreach nested of a class articles, in which I go through two lists, and if the item in list 1 is in list 2, it must do a couple of operations, the dilemma is that when dealing with very long lists, it takes a long time and I nee...
asked by 04.07.2017 / 04:10
2
answers

Fragment of static code

I am translating a Java code to C # and I found this code snippet: static { for (int i = 0; i < 64; i++) TABLE_T[i] = (int) (long) ((1L << 32) * Math.abs(Math.sin(i + 1))); } From what I read, java lets you define stati...
asked by 17.04.2018 / 18:21
1
answer

Problem with the enums

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ejercicio_2 { class Program { enum direcion { arriba=1,abajo=3,derecha=2,izquieda=4}; static void Main(stri...
asked by 16.10.2018 / 10:44
3
answers

How to predefine columns in a DataGrid filled with data from a database?

I want to give an already defined style of columns with their title and everything to a DataGrid, I present the records of a table called users where I use the following code made from C # with Visual Studio 2017 public void mostrarTabla()...
asked by 07.04.2018 / 21:38