Questions tagged as 'c#'

1
answer

What are the differences between a DataTable and a DataReader for MySQL queries in C #?

I am creating a C # project with MySQL, my connector follows the Singleton pattern and I use MySqlDataReader to retrieve the data from the table and popular a List so far so good. My problem started when I had to recover data from one table b...
asked by 26.01.2015 / 20:58
3
answers

How to convert an Object to an Array? (W#)

I have the following class: public string Nome; public int Cpf; public string getNome() { return Nome; } public void setNome(string nome) { this.Nome = nome; } public int getCpf() { return Cpf; } public void...
asked by 27.09.2015 / 23:01
1
answer

Remove "openfiledialog" from C #

Good, I have an OpenFileDialog in my program, but I did not want it to appear when I "open" what is in the image ... If I close the window, it gets "openfiledialog" in the Textbox, and I want it to be blank, since nothing was selected. Im...
asked by 29.09.2015 / 10:25
1
answer

Updating collections with entity framework

Is it possible to update the Collection of an entity with relationship one-to-many through its navigation property ? public class Foo { public virtual IList<Bar> Bars {get; set;} public int FooID { get; set; } }...
asked by 23.09.2015 / 14:25
2
answers

Reading HTML pages with .NET Core

Next, I have a code that reads a particular web page: private string GetCodePage() { WebRequest request = WebRequest.Create(URL); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResp...
asked by 28.06.2016 / 16:30
2
answers

Insert image in body of email

How do I insert an image into the body of the email using C #? I have already been able to send as an attachment but I would like to know how to proceed to send it in the body of the email, is there anything that makes this possible?     
asked by 08.12.2015 / 19:32
1
answer

I can not remove a reference installed by NuGet

I installed DLL Log4net with nuget . As it is in a different version of ours and a colleague gave me the usual one, I deleted it from the folder and put the current one. When I validate the solution / project, the version that wa...
asked by 01.12.2015 / 17:54
2
answers

Error in .First (), because there is no result selected

In my controller login I use the following code to make the user selection if it exists, however whenever the user types the incorrect name or password, an error because it does not find the result for .First . I need to make a treatmen...
asked by 04.12.2015 / 20:25
1
answer

Copy Text button in C #

I am new to C# , and wanted to create a button that when clicked, it will copy the text described on the same button. If I did not make myself understood, imagine that the button has a text inserted in it (eg: Csharp ), when you clic...
asked by 10.10.2015 / 02:20
1
answer

What is the use of default interface methods?

I was seeing some features proposed for C # 8 and I came across the default interface methods .    Add support for virtual extension methods - methods in interfaces with concrete implementations. So I understand it is to allow implementa...
asked by 07.09.2017 / 00:15