Questions tagged as '.net'

3
answers

How to catch a NullReferenceException?

When I test my application, it returns some specific data, but when the requested data is null, this unhandled exception error appears ItriedtocapturehimbutIthinkI'mwrong.HowcanIleaveatreatmentthatwarnsinatextboxthattherequesteddatawasnotfou...
asked by 26.11.2015 / 01:24
3
answers

Is there Data Annotation that avoids duplication of data in the Bank?

How do I prevent data being duplicated in the database using Data Annotation or would it be through another validation?     
asked by 10.11.2016 / 16:18
3
answers

How to get the executable path open in C #

How do I get the project path in C #? Is there a function? Or do I have to type the full path in my application?     
asked by 12.02.2014 / 19:02
2
answers

Dividing 1/2 in C #

In some videos in numberphile on the Zeno's Paradox the teacher of the video tried to explain how this paradox worked using the hands to beat palamas (I'm not sure how to explain this but I'll leave the video there in question, please watch...
asked by 15.01.2015 / 14:38
2
answers

How do I update an item from a generic list?

I'm trying to change the name and email of a certain item from the list below, but found no way other than to remove the item from the list and add it upgraded again. Is there another way to update? class Program { static void Main(string[...
asked by 16.09.2015 / 20:48
3
answers

"Clean" way to modify the "visible" attribute of a PictureBox

I have 5 background images for my application that will be visible to the user's taste. What is the simplest (clean code) way to make the user choose? private void radioButton1_CheckedChanged(object sender, EventArgs e) { pictu...
asked by 29.05.2014 / 01:47
5
answers

Regex take from one point to another within a text

I have the following text: From: .... blabla bla Message: blablabalab //linha em branco From: .... blabla bla Message: blablabalab //linha em Branco From: .... blabla bla Message: blablabalab How do I make my regex pick up where From...
asked by 16.03.2015 / 13:08
4
answers

"Filter" equal records in a list by adding their quantitative

namespace ConsoleApplication10 { class Program { static void Main(string[] args) { List<Teste> lstTeste = new List<Teste> { new Teste {Codigo = 1, Quantidade = 10},...
asked by 22.09.2015 / 22:22
2
answers

Alternatives to developing VBA in Office

At work I have a large code base written in VBA (about 13 active projects) for both Access and Excel applications. I have been trying to refactor some things, but several factors are making my work difficult, like: The IDE that comes with...
asked by 17.10.2014 / 15:26
1
answer

How to read folder and subfolder files?

I have a function to read the files from the folder, and it is not working. I need a functional function that reads files from folders and subfolders. Here is the code: FolderBrowserDialog fbd = new FolderBrowserDialog(); DialogRes...
asked by 05.09.2014 / 19:31