Questions tagged as 'c#'

2
answers

Change a Textbox from thread and external class? C #

I have the following problem, I have to do a program that checks if X things are active, making queries to a database and showing them in a form. It's something of this style more or less.    Note: I omit some parts of the code because I t...
asked by 21.11.2017 / 16:02
1
answer

How to create a picturebox dynamically in C #?

Well what I want to do is the generation of several boxes of images in my application of C #, in a few words a history of the images uploaded to my application. I currently have the following code: Image Generation Code (Does not work)....
asked by 05.04.2017 / 19:14
3
answers

Check latest registration through linq

I have to get the most updated record from the following table for the most recent record query (the most recent date) I have the following sentence contexto.Set<Tabla1>().LastOrDefault(x => x.Id_Registro == idRegistro); i...
asked by 22.03.2017 / 14:00
2
answers

File to Integer Array

Currently I have a txt file where there are many lines, each of these lines can be a string, an integer, a line break, etc ... The fact is that I'm looking for a clean way to load lines that are integers in a list of integers. Doing it by mea...
asked by 11.09.2017 / 09:19
2
answers

Convert datetime "DD / MM / YYYY" to a string "YYMMDD" in C #

I have the value of a date in a DateEdit which the default value is DD/MM/YYYY and I need to convert it to a string format YYMMDD to show it in a TextBox since it will define the name of a task on that date....
asked by 09.08.2017 / 16:30
1
answer

C # Change the action of the enter in DataGridView

I want to change the default action so that the code does not skip the line, what I want to achieve is that when you touch the Enter select that row and return an ok. if (e.KeyChar == Convert.ToChar(Keys.Enter)) { this.DialogResult = Sys...
asked by 13.07.2018 / 09:40
1
answer

How to truncate decimals in datagridview c # column?

I have a DataGrid that receives your information from the database through an SP, in one of the fields, I need to truncate to two decimals instead of rounding it up so that if I have a value as 99.9999578 , stay in 99.99 and...
asked by 31.08.2018 / 19:59
2
answers

Help in the sql query (sum)

I'm doing a Query where I add the amount of products that I have after multiplying it .. This is the Query. declare @Sucursalid int set @Sucursalid = 1 SELECT i.sucursalid as SucursalID,( COUNT(p.id) * p.pesomililitros) AS Cantidad...
asked by 29.08.2018 / 18:12
3
answers

How to Order Vectors in C #?

How can I get my vector ordered from lowest to highest, what happens is that I already have my method that I should do that, only that I have a logic problem, since it marks me error when making my if public void ordeanar() {...
asked by 22.09.2016 / 17:46
1
answer

ASP.NET Calculator

I'm doing a small exercise of operations consuming a Web Service, but I can not find a way to show the result in the view, I'm not using Model. controller { return View(); } [HttpPost] public ActionResult Index(int primero, int segundo...
asked by 11.01.2018 / 15:15