Questions tagged as 'c#'

1
answer

Why Arrays implements IEnumerable but does not implement IEnumerableT?

I was making a class that contains an Array of class Episode : public Episode[] EpisodesList; Then I implemented IEnumerable<T> in my class. And as expected, I implemented the method GetEnumerator() ... p...
asked by 15.04.2015 / 06:57
1
answer

Get Selected RadioButtons in WPF

I have several radiobuttons on my form, each with a content different. How do I get the radiobuttom selected? Without having to método to check one by one.     
asked by 16.08.2015 / 17:01
1
answer

How do I know if a Client is accessing the server over the local network or the internet?

How do I identify if the client is accessing my application, whether it is inside the company (local area network) or outside (internet)?     
asked by 20.08.2015 / 13:25
1
answer

How to save text in xml or txt or html file?

I'm developing a C # program and would like to know how to save the text of a RichTextBox in .xml or .html or .txt format.     
asked by 17.08.2015 / 22:16
1
answer

How to get the path of a file (HttpPostedFileBase)?

I would like to get the path from where my file is coming from. Model: [Required(ErrorMessage = "Selecione o arquivo a ser importado.")] [Display(Name = "Arquivo ")] public HttpPostedFileBase Arquivo { get; set; } View: @Ht...
asked by 26.10.2015 / 19:46
1
answer

Entity Framework - Deleting object with relationship

I have a question for understanding the behavior of Entity. Because when I pass null to a property the Entity should not "clean" the relationship in the bank? My Model: public partial class Ocorrencia { [Key] public int id {...
asked by 29.03.2017 / 19:29
1
answer

Session and ViewState Comparison with String

I recently received the following Visual Studio warning in code similar to the image: Iunderstandwhathewantedtotellme:thereisareferencecomparisonofthetwovalues(ofthesessionandofthe"test" string), and this will always return false , sin...
asked by 08.03.2017 / 18:20
1
answer

How to simulate the event of typing the% symbol (%) when pressing Shift + 5?

I was developing a calculator in C #, and I started to do the activation part of the buttons through the keyboard. if (e.KeyCode == Keys.Add) { btnsum.PerformClick(); } Using the above code, I've already been able to do most of th...
asked by 24.04.2017 / 19:42
1
answer

Error when connecting PostgreSQL to the Entity Framework

I'm trying to connect to EF in Postgresql. You are running the following message:   An unhandled exception of type   'System.Configuration.ConfigurationErrorsException' occurred in   System.Configuration.dll       Additional information: An...
asked by 24.03.2017 / 02:11
2
answers

DropDownList Quantity Items

Good morning, I'm using dropdownlist in asp.net to load some data coming from the bank, however I do not know the amount that will be shown, because it depends on the fill in the bank. I'd like to show only a certain amount of i...
asked by 12.04.2017 / 15:18