Most viewed "c#" questions
This tag should be used when the question refers to some resource, information or problem related to the C#language. C# ("C Sharp") is a multi-paradigm programming language that has strongly typed variables, is imperative, declarative, functional, generic, object-oriented and component-oriented, which are designed to be executed in . NET Framework.
Learn more…13,899 questions
Sort by count of
-
10
votes2
answers73740
viewsHow to access the print screen image?
When we hit the button Print Screen from our keyboard, the screen image is saved in some cache, in memory, somewhere, because when we give Ctrl V after, in Paint for example it trims, how to access…
-
22
votes3
answers57329
viewsFormat double with mile and decimal
I have the following value: 43239.110000000001 I used this command: txtSomatorio.Text = String.Format( "{0:#.#,##}", somatorio); I got this: 43239,11 How to do to display like this? 43.239,11…
-
2
votes1
answer53928
viewsHow to resolve Object Reference Not Set To An Instance Of An Object
I have a serious problem. I have a Gridview populated with data from a Mysql BD working perfectly. I also have a button to turn it into a table to be inserted into a PDF using iTextSharp that also…
-
5
votes3
answers51028
viewsRegex - Special Character Removal C#
Regex.Replace. is a great solution to remove accentuation. Now I just can’t do the removal of a character type, I have a string that receives the text "1° General Place", string has the character…
-
71
votes8
answers49747
viewsHow do I remove accents in a string?
I have a string áéíóú That I want to convert to aeiou How do I remove accents? Need to save to database as a URL.
-
35
votes8
answers45010
viewsWhat is the difference between C# and ASP.NET?
What’s the big difference about ASP.Net and C#? I program in C# for desktop, but I can’t understand. C# para desktop (Windows Forms Application) is identical to the C# used in web programming? And…
-
2
votes3
answers42978
viewsHow to make a select with multiple `Where field like '%'` in C#
select below even works, but it searches all fields and would like the idaluno, nomealuno and cpf were searched and ordered by idaluno SELECT…
-
6
votes3
answers42780
viewsHow to change date format in bootstrap from mm/dd/yyyy to dd/mm/yyyy
That’s the mistake you’re making: Uncaught Typeerror: Cannot set Property 'en-BR' of Undefined Insert some links to format the date, according to what I took on the net and even then the date is…
-
14
votes1
answer41651
viewsFormat value with Brazilian currency mask
I have a stored trial that returns a credit amount for a certain consortium quota. The return of that value would be like this: 167900. But it should be so: R$ 167.900,00. This value I feed a…
-
1
votes5
answers38715
viewsCalling a form and closing a form in the same event
How do I call one form and close a form at the same event. For example: private void iniciar_Click(object sender, EventArgs e) { Close(); Frm1 newForm2 = new Frm1(); newForm2.ShowDialog(); }…
-
49
votes6
answers32712
viewsAbstract Class X Interface
What is the difference between an abstract class and an interface? I don’t understand when I should use one or the other.
-
14
votes3
answers30199
viewsHow do I round numbers to the nearest integer?
I have numbers double as double a = 0.4, b = 0.5; How do I round it up?
-
5
votes5
answers29254
viewsHow to convert date to dd/MM/yyyy format?
After I published my app, I started to receive the dates in the American format like this:9/14/2016 12:00:00 AM How to format to dd/MM/yyyy? I tried to convert.ToDateTime() more does not work.…
-
31
votes4
answers28968
viewsWhat is the most appropriate way to concatenate strings?
There are different methods for concatenating strings, such as Concatenating with the operator "abc" + str Formatting String.Format("abc{0}", str); Using the Stringbuilder new…
-
37
votes1
answer28542
viewsWhat are the most relevant differences between C# and Java?
I wanted to know the most relevant differences that I should know exist between these two languages. Why am I asking this here? Because normally in my day-to-day when I ask this question, my…
-
14
votes3
answers27590
viewsHow to encrypt and decrypt MD5 data using C#?
How to do MD5 encryption with C# of a text or file? And once it’s encrypted, how to decrypt?
-
6
votes2
answers26381
viewsProblem connecting to SQL Server 2012 database on IIS
I cannot run my system queries on IIS, when running in Visual Studio I can get the result easily. The mistake I get when I try to do something is this::…
-
20
votes2
answers25606
viewsWhat kind of data (double, float or decimal) should I use to represent currency in . NET with C#?
Although I am aware of what would be better to use, I ask this question for educational purposes since I see several examples of people using double in C#. But I’ve had problems with double for coin…
-
11
votes4
answers25519
viewsThe input character string was not in an incorrect format. Operators
Hello, I’m beginner in programming and I’m trying to show the user how much RAM is being consumed at the moment, I’m using the following code that is not pointing nor an error when compiling only…
-
19
votes7
answers25439
viewsHow to convert a JSON response to a C#object?
I’m making a request and getting a JSON like this: { "id": "1000000000000000", "name": "BrunoLM", "first_name": "Bruno", "last_name": "X", "link": "http://stackoverflow.com/users/340760/brunolm",…
-
71
votes4
answers25411
viewsWhat is addiction injection?
I have heard a lot about addiction injection. The question is: How, when and what to use?
-
10
votes4
answers25170
viewsFormat a CPF string?
I have a problem, in an app the user type the CPF, but only the numbers because it is very complicated to create mask on Windows Phone, and this CPF will be 'drawn' in a picture of a card, and to…
-
39
votes3
answers25089
viewsWhat is the function of a static method?
Is it just convenience? I mean, it’s unnecessary to instantiate an object to use a function that doesn’t use the data from it. Is there a difference in execution? Memory, processing - resources in…
-
48
votes3
answers24523
views -
5
votes2
answers24321
viewsThe SMTP server requires a secure connection or the client has not been authenticated
I’m having the following mistake, working with SMTP and MailMessage in the C#: The SMTP server requires a secure connection or the client has not been authenticated. The server response was: 5.5.1…
-
63
votes3
answers24262
viewsWhat is the difference between Ienumerable, Iqueryable and List?
What’s the difference between Ienumerable, Iqueryable and List no . NET? When it’s best to use one or the other? Why does Resharper suggest that I modify the return of that function, for example,…
-
39
votes3
answers23304
viewsWhat is the difference between "passing by value" and "passing by reference"?
I know that in the first the object passed as an argument to a function is copied, and in the second not. I also know that it is extremely unusual in modern languages to pass complex objects by…
-
9
votes1
answer22992
viewsAccess Mysql with C#
I’m creating a Form simple that has 3 TextBoxes and 3 buttons and I want to save the information typed in Textboxes in a table. I’ve already created the querys all within a class acessoBD, but I…
-
82
votes7
answers21276
viewsBest kind of data to work with money?
I am developing a project for commercial automation, using PAF-ECF and everything else. Would Aual be the best type of data to work with SQL Server and C# for money issues? Mainly in relation to…
-
14
votes3
answers21251
viewsWhat is a virtual class, attributes and methods?
What is a class, attribute and virtual method? public virtual class nomeclasse { public virtual int id { get;set; } public virtual void metodo() { } } What difference? When to use?…
-
7
votes4
answers20874
viewsHow to extract only numbers from a string?
I want to extract only the numbers of a CPF that is in a string in this format; 111.222.333-44 You have to return only: 11122233344…
-
58
votes7
answers20675
viewsWhat are lambda Expressions? And what’s the point of using them?
When I started using LINQ I saw I could use the famous lambda Expressions. Until I know that x => x * x is a lambda Expression, but I could not explain to a colleague what they really are, and…
-
6
votes3
answers20560
viewsPick first and last name and abbreviate middle names only with the initial
I would like to address the following string: string nome = "Rafael Rodrigues Arruda de Oliveira" With the following criteria:: Keep first and last name; Abbreviate the other names (middle names)…
-
8
votes5
answers19908
views.NET C# IIS Request cancelled: Failed to create secure channel for SSL/TLS
Gentlemen, I am trying to communicate with the recipe/SEFAZ server using an A1 certificate through an MVC5 C# application on an IIS 8 server, in the pool with my user identity. The certificate is…
-
10
votes2
answers19497
viewsHow to get a snippet of a string?
I have a string like this: ~/Areas/Teste/Views/home/index.cshtml I just need the word that comes right after ~/Areas/, in the case Teste (remembering that this word may vary in size). How do?…
-
68
votes1
answer19312
views -
8
votes3
answers19310
viewsAlternatives for developing in C# on Linux?
My notebook has installed the Ubuntu 14 operating system. I have great desire to enter the development in the language Csharp. But I wonder if there is a good alternative in OS like Linux, since it…
-
5
votes3
answers19154
viewsHow to take the path of the open executable in C#
How do I take the path of the project in c#? Is there any function? Or I have to write the full path on my application?
-
29
votes3
answers19104
viewsUnderstanding threads in C#
I’m trying to figure out how to use Tasks and asynchronous methods in C#, but every place I see about it in internet mentions a "usual multithreading" form that would be different from the use of…
-
0
votes2
answers19039
viewsCreate an executable
Good morning, I made an application in C# recently but it’s still only in code form and I needed to create an executable ! But I’ve never done it, I don’t know how. Can anyone help ? Thank you !…
-
10
votes3
answers18905
viewsAlgorithm for betting creation on Lotofácil
One of the ways to bet on Easy Bet is to choose 15 numbers from number 1 to 25. I would like an algorithm in c# that generates bets. Remembering that in each combination the numbers cannot repeat…
-
7
votes1
answer18750
viewsHow to integrate the application with Whatsapp?
I was wondering if it is possible to integrate an application made in C# with Whatsapp?
-
11
votes3
answers17994
viewsWhat is the Difference Between HTML.Actionlink vs Url.Action?
Reading some tutorials of ASP.NET MVC I found these two helpers being used to do basically the same thing, which was to direct the user to a new view. So I wonder if there’s any more remarkable…
-
9
votes1
answer17765
viewsFill Data Grid View with object property
I have a form where I need to fill out a DataGridView with data from a user list. To generate this data, I used 3 classes: User class namespace TesteDataGridView { public class Usuario { public int…
-
15
votes5
answers17754
viewsHow to solve accent problems with ASP.NET MVC?
I’m having problems with accentuation in ASP.NET MVC 5. I am using Visual Studio 2013 Professional and in the application . Net 4.5. SQL Server 2008 and Entity Framework 6. The browser is Google…
c# asp.net-mvc asp.net-mvc-5 entity-framework visual-studio-2013asked 10 years, 11 months ago user3628 -
15
votes2
answers17329
viewsWhat does "!" (exclamation) mean before a code snippet?
There are many basic things I do not know, for example how to read exactly this exclamation the way it is placed in the following section: if…
-
13
votes3
answers17303
viewsWhat is the best way to read an XLS file?
I would like to know the best way to read an XLS file in C#. I can handle it the same way I handle a database table?
-
4
votes2
answers17227
viewsUnable to load file or Assembly 'Webgrease, Version=1.3.0.0, Culture=neutral
I am just opening a new project based on MVC 5, framework 4.0, c#, and after opening the project for the first time and compiling, error occurs Não foi possível carregar arquivo ou assembly…
-
0
votes1
answer17194
viewsUndefined object reference for an instance
"Undefined object reference for an object" instance I have this problem here in my project in Asp.net and I have not been able to move forward with it for a long time, please would you take a look…
-
10
votes4
answers16962
viewsWhat do you call a "Stored Procedure"?
How to call a procedure in ASP.NET C#? Follow my simple procedure: CREATE PROCEDURE GetAdmin ( @email VARCHAR(50), @password VARCHAR (50) ) AS BEGIN SET NOCOUNT ON; SELECT * FROM Admin WHERE Email =…