Questions tagged as '.net'

1
answer

How to calculate days, ignoring hours

How can I calculate if you spent 1 day, ignoring the hours. Explaining, it would look something like this: I have a date 2017-09-09 11:45:20 , normally it would have been 1 day, when the 11:45 arrived the other day, however I would li...
asked by 10.09.2017 / 18:21
2
answers

Faster way to add an item to a list, use a structure

Structure turma Public id_turma As Integer Public nome_turma As String End Structure Structure Disciplina Public id_disciplinas As Integer Public nome_disciplina As Integer End Structure Public Class F_Contentor Dim turmas A...
asked by 22.02.2016 / 18:35
1
answer

Variable with unassigned value within a FOR Loop

int i; string cpf; cpf = "11111111111"; DbConnection cnx = ADO_Utils.GetConnection(); DbCommand cmd = ADO_Utils.GetComando(cnx); cmd.CommandType = CommandType.Text; for (i = 1; i < Convert.ToInt32(txbQtde.Text); i++...
asked by 21.04.2016 / 03:59
2
answers

Return the path value

How to return the value with the name of a folder in C #? Example, if I execute: Directory.GetFiles("%PROGRAMFILES% (x86)\MyApp", "*.*", true); And if you can do it, it returns like this: %PROGRAMFILES% (x86)\MyApp\MyApp.exe %PROGRAMFI...
asked by 27.09.2015 / 17:41
1
answer

Destroying an instance

How do I destroy an instance? I have an object whose instance is referenced in various parts of my code. At some point I need to delete this object and for this I am doing the following: meuObjeto = null; The problem is that this code is...
asked by 27.10.2015 / 01:05
3
answers

Directory Problems

I'm trying to read from an .html file but I can not get the path to this file. I already used Environment.GetCurrentDirectory and Directory.GetCurrentDirectory but did not succeed. Below is the code I'm currently trying, but it tri...
asked by 12.03.2015 / 20:12
1
answer

Convert string to specific format in date

I have a string "sex, nov 6" and need to convert to DateTime . I'm doing it this way: DateTime datetime = DateTime.Parse(gridT.Columns[e.ColumnIndex].HeaderText.ToString()); But it is not working. How can I do this conv...
asked by 06.11.2015 / 12:42
3
answers

Pass List as expression parameter LINQ

I have a LINQ expression where the result is saved in the query variable, which is transformed into a list, this query returns a series of "RA" attributes. p> I would like to pass this list of attributes as a parameter in the LINQ expressi...
asked by 04.11.2015 / 03:26
2
answers

Implementing relationship in C #

I have the following classes: Thecodelookslikethis:publicclassMae{publicstringNome{get;set;}publicList<Filho>Filhos{get;set;}}publicclassFilho{publicstringNome{get;set;}}Inthiscase,itispossibletogetallthesonsofthemother,butitisnotpossi...
asked by 09.11.2015 / 15:01
1
answer

How to locate an image without informing the absolute path?

How to locate an image without entering the absolute path? Image img = System.Drawing.Image.FromFile("~/Content/images/SemFoto.jpg"); I tried in many ways and could not capture the image without telling the absolute path. The above line of...
asked by 03.11.2015 / 14:43