Questions tagged as 'c#'

2
answers

C # compare two files by their properties

I need to compare two text files for their properties in C #, and not for their content. For example, by creation date and by modification date. I have managed to compare it by the content, I leave here the code: private bool FileCompare(strin...
asked by 28.09.2017 / 09:34
2
answers

What is the equivalent of the VBA keyword "TO" in C #?

I'm passing code from vba to c # but I can not find the keyword " To " for c # Example: Xl = -1208721221 Xr = -38092073 Const ROUND = 16 private m_pBox(0 To ROUND + 1) As Long Private static Sub DecryptBlock(Xl As Long, Xr As Long) Dim...
asked by 06.03.2017 / 15:32
5
answers

C # Is any conversion missing?

It is assumed that a person enters a line of characters per keyboard separated by a blank space followed by another line of characters, the program should indicate if the characters that are separated by the blank space have the same amount for...
asked by 27.03.2017 / 22:55
2
answers

Show message "no results" in gridview

How can I display a message so that when I search in a datagridview if there are no results the message is displayed.     
asked by 09.12.2016 / 22:20
2
answers

Error connecting SQL-SERVER with C #

Good morning everyone I have the following code to establish a connection to a database SQL-SERVER 2014 . using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text;...
asked by 06.04.2017 / 17:44
2
answers

I need to indicate how many times the highest value of an arrangement is repeated

I must tell the console to print the number of times a value is repeated, in this case, it is the largest int, which would be the highest value of the vector, try a few things, but I am stuck, I will leave the code here . If I can make you te...
asked by 06.12.2018 / 02:09
2
answers

Error ArrayList

I have the following code: using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LINQArrayListTips05 { class Program { static vo...
asked by 29.11.2018 / 15:18
2
answers

Return a class with two properties from one method

Good I'm doing a function that returns two results. I have been doing but I get error error could help me. the code is as follows: public entidadd calcular() { return new Double[] {2,3}; } public class entidadd { double numero1; dpubl...
asked by 07.11.2018 / 19:15
2
answers

how do I set the number of decimals I want to show from a double in c #

My problem is that I am using Math.Round and it is rounding, what I need is that it only shows me a single decimal without being rounded This is my normal result double rap = 0; rap = (11300 - 8508.54)* 0.015); That this gives me...
asked by 12.11.2018 / 21:45
3
answers

Problem with Try-Catch

It tells me "use of the unmapped local variable" date "and it does not let me even compile. Should I not if or if I enter the Try and run time maybe give me error? DateTime fecha; try { Console.Write("Fecha de n...
asked by 16.06.2018 / 00:50