Questions tagged as 'c#'

2
answers

What is the error of this algorithm? [closed]

I would like to see if you could help me find the error in this algorithm, the exercise says to calculate the discount: if m> = 300 the discount is 25% - if 150
asked by 23.06.2017 / 18:34
1
answer

C # understanding inheritance

I got a problem understanding inheritance, I have my superclass "servivo" that has a constructor which receives a string, which would be the name of the servivo, besides this it has a method called "breathe" which prints on the screen string + "...
asked by 09.05.2017 / 01:23
4
answers

ProgressBar does not activate Winform

I have a proguesBarr defined in my program as visible=false I want to show and activate when clicking create new game, this button is to initialize all user data in the database, with the Default data required which takes between 2...
asked by 28.03.2018 / 09:55
1
answer

Dates conversion problem?

Well my problem is as follows, I have to save a datatble with several records between them some dates, and I try to save them through a stored procedure that executes a table-type variable that is where I deposit all my values. all the code well...
asked by 16.03.2017 / 20:04
1
answer

For Serving Comments with 3 Lines

There are comments with 3 lines but I can not find its operation, I doubt it is a simple comment since when using three lines the comment darkens but when adding two, four lines or more it returns to its original color in which I called attentio...
asked by 09.04.2017 / 00:46
2
answers

Show return value SQL Server in WPF window C #

I have the following code with which I recover the value that a stored procedure returns to me public bool EjecutarSQL(string consecutivo, string otratabla) { Clsconexion objConexion = new Clsconexion(); objConexion.SQL = "...
asked by 06.12.2018 / 16:26
2
answers

How to subtract hours from a DateTime?

I have a DateTime and I need to subtract hours from one column to the other. For example, I want to subtract 12:45:00 - 12:25:00 and have the result 20 . This is the code I'm using for (int i=0; i<n; i++) {...
asked by 13.12.2018 / 04:13
2
answers

Pass variable from one form to another in WPF

I have the following problem I am trying to concatenate a variable that I get from one form to show it in another, I do it in the following way. 1.Formular ClsIntermedia objLibreria = new ClsIntermedia(); if (objLibrer...
asked by 19.12.2018 / 13:38
2
answers

How to use an event from a datagridview that was implemented manually at the end of the Code

If I create a DatagridView in this way: DataTable table = new DataTable(); //DataTable is filled with values here... DataGridView grid = new DataGridView(); foreach (DataColumn column in table.Columns) { grid.Columns.Add(column.ColumnName,...
asked by 18.12.2018 / 17:40
2
answers

Problem with the indexer being read-only C #

I declare the following: public string caracter = new string(new char[1]); But when I call it later and try to give it a value it does not leave me and it takes out an indexer error caracter[0] = 27; //No me deja darle valores me saca el...
asked by 11.12.2018 / 16:57