Most voted "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
-
1
votes2
answers3651
viewsThe 'Oracle.DataAccess.Client.Oracleconnection' type initializer triggered an exception with c#
My wpf program worked very well. They moved it to make some changes. Well, they asked me to change some folders in the application. Before I make any changes I went to run the application and is…
-
1
votes1
answer274
viewsStandardize error messages in Dataannotations in Viewmodels classes
It is possible to standardize the error messages used in Dataannotations, so that it is not necessary to pass a string like: [Required(ErrorMessage = "Este campo é obrigatório.")] But you can use it…
-
1
votes1
answer384
viewsInteract with Windows service to send and receive data?
I created a service on Windows is installed on localhost and now has to interact with this service. Within my web application I will give a query command that will be sent to this service and this…
-
1
votes1
answer41
viewsVisual Studio 2015 compilation alert
Say guys I’m developing a project in Windows Forms, and recently I upgraded Visual Studio 2010 to 2015, however when I did the installation of VS 2015 I realized that there was no report View so I…
-
1
votes2
answers324
viewsFirstordefault, Singleordefault, Elementatordefault
What is the difference between the elements FirstOrDefault and First, SingleOrDefault and Single or ElementAtOrDefault or ElementAt. When to use with and without the Default?…
-
1
votes1
answer51
viewsProblems with Folderbrowserdialog. Application hangs
I have an application (WPF) that has been working for a couple of months without problems. I needed to make a change. When doing, in the line where you should choose a printer to store the result of…
-
1
votes1
answer439
viewsReturn DB value in a variable
I am trying to return the largest ID of the table Orcamento in a variable, but it returns me an error: An unhandled Exception of type 'System.Nullreferenceexception' occurred in Mysql.Data.dll.…
-
1
votes1
answer3276
viewsC# - Separate/cut string by commas (but with monetary value included in the string)
I have a problem reading a txt file that has its columns separated by comma but also has monetary values that are being cut and should not, because they are in quotes. Follow example of the line:…
c#asked 8 years, 6 months ago Iago Correia Guimarães 799 -
1
votes0
answers132
viewsSelenium c# - API Mass of tests
Good afternoon, you guys. I have a problem, and your help is important. I have a mass of tests written in Testmanager online and my scripts are in visual studio 2015. My VS scripts log in to…
c# visual-studio-2015 team-foundation-server selenium-webdriverasked 8 years, 6 months ago Anderson Alves 31 -
1
votes1
answer2621
viewsHow to call the form inside another - Visual Studio
I have the parent form with a Trip menuStrip. I’ve already set him up as isMdiContainer = True And I have another form I call Services. In the event MenuStrip > Service I put this:…
-
1
votes2
answers28
viewsHow to intercept the project save event on vssdk?
I am currently developing an extension of visual studio 2017 where I need to know when any changes in the project are persisted. E.g.: When I add a new reference to the project (I know there are…
-
1
votes0
answers39
viewsConstrutores Estáticos
Why can’t I declare a static constructor function? Is there any problem with context?
c#asked 7 years, 2 months ago DiegoSantos 1,004 -
1
votes1
answer2049
viewsForeach in Select and List
I recently discovered that there’s a big difference between doing some operations, like Select and Where, in Queryable and listed objects such as Enumerable and List. In this and in this question.…
-
1
votes0
answers549
viewsHow to place markers on the x-axis of a Chart line c#
I would like to know how to leave markers (such as a ball) on the X axes at each point of the graphic. Currently the graphic is like this: I wanted every month to be able to have a dot dot ball…
-
1
votes0
answers24
views"Enumerable.Cs not found", how to adjust?
After initializing a "Contentpage", the following error appears: "Enumerable.Cs not found". In fact, I couldn’t find the file. "Enumerable.Cs" is unique to "System.Core"? I tried to install…
-
1
votes0
answers34
viewsChange Cultureinfo to MVC5 / C# and Multi-tenancy
Good afternoon folks! I am working with MVC5 and need a help in the following situation.. I have a view that contains a language selector, and needs to dynamically change the content after selecting…
-
1
votes0
answers223
viewsXamarin - Load Frame with Image inside a Contentview
I want to change this Sketch so I can draw in a photo. I lowered the github and I’m making the modifications. However, I am not able to load an image on the screen when setting the Image Source.…
-
1
votes1
answer35
viewsRest API does not receive anything from another App other than my own
You can prevent another application from sending or receiving information from my REST?
-
1
votes1
answer854
viewsList, virtual and Entity Framework
In all the examples I have found about Entity framework, always use ICollection for collections of objects. public partial class Standard { public Standard() { this.Students = new…
-
1
votes1
answer33
viewsExplanation for the error in the following code
I started to solve the problems of the Euler project as a form of training in learning. If we list all the natural Numbers Below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of…
-
1
votes1
answer472
viewsGrab file size through Openfiledialog and save to a List<Attachment>
I’m making an application Windowsforms to send email, within this application I have an Opendialog that selects the files and saved within a: List<Attachment> AttachmentList = new…
-
1
votes2
answers261
viewsInheritance in the Entity Framework
I am now reading about cross domain inheritance in EF. I came across this example: public abstract class BillingDetail { public int BillingDetailId { get; set; } public string Owner { get; set; }…
-
1
votes2
answers85
viewsUnsaved relationships
Have that question where thanks to the help of colleagues I managed to resolve my situation. Well, at least in parts... After making the adjustments pointed out, the data is being saved. But the…
-
1
votes1
answer49
viewsFilter query
To insert a filter in my query the command is in a repository and I want to insert a filter in it, it can be by name for example. Code: public IList < T > Consultar() { using(ISession session…
-
1
votes2
answers301
viewsConsuming web service wsdl . net framework 2.0
When generating the request with all the correct parameters I have error return 307 Temporary redirect. Someone knows tell me what this error represents ?
-
1
votes2
answers326
viewsVector receives method return
I am assembling a program in C# and created a method called Supply that receives an array called a number and returns the same. The idea is that the supply function creates random values, fill in…
-
1
votes1
answer116
viewsConfigure Multiple Windows Services in a Single Project
I am developing a project like Windows Services and I came across the need to perform routines with different runtime and rules. It is possible to have multiple windows services in a single project?…
-
1
votes1
answer120
viewsSelect field in Webbrowser
need to access this site https://free-proxy-list.net/ and select 8080 port option. Any hint? Abs
-
1
votes1
answer514
viewsHow to put subtitles at the bottom of the Chart?
I have been trying to work with Chart in C#. But now I can’t leave all the subtitles underneath their respective columns. The image shows that caption 1, 3, 5, 7, 9 and 11 are not appearing, even if…
-
1
votes2
answers230
viewsIs there a difference between the use of the underscore and the . this?
From what I’ve seen, we use underscore for class internal variables: class Pessoa { private string _nome; public Pessoa(string nome){ _nome = nome; } } For this case, the use of . this, would be so?…
c#asked 7 years, 1 month ago Lucas Augusto 159 -
1
votes1
answer63
viewsInvalid enumerator when trying to add a filter using WFP by C#
I’m trying to bear a code of c++ to c#. My goal is to block a website using WFP. After translating the code, I seem to have missed something because when adding a filter I get the message "An…
-
1
votes1
answer40
viewsError trying to set Npgsqldataadapter Missingschemaaction property
I’m trying to set the property MissingSchemaAction of an object NpgsqlDataAdapter, but Visual Studio is complaining that the property does not exist. I looked at the github of the project and saw…
-
1
votes0
answers53
viewsHow Utorrent Opens by Browser
Hello, I intend to create a program that when it is called by the browser, it opens the program and runs its functions, similar as utorrent does. I did some research but found nothing so far and do…
-
1
votes0
answers1034
viewsHow to get the creation date of a c#file
I have a web system in c# and I am using framework 4.5 that accesses a database Firebird that is on a server, I am connecting to this database normally. Now I need to have access to the creation…
-
1
votes1
answer244
viewsHow to display domain validations and errors in a partial modal bootstrap view?
I am using DDD and have some validations in my domain that need to be done, but when I use Modelstate.Addmodelerror and return my model and my Partialview, the form of my Partial does not remain in…
-
1
votes2
answers258
viewsHow to compare with Guid Mvc
Hello, I would like to make this comparison using a Guid, public Guid ClienteID {get;set;}. This code works using a int, I make a if, if my ClienteID == 0 I save, and if it doesn’t equal 0 I change.…
-
1
votes1
answer2787
viewsC# Datagridview align header in center
I am suffering to be able to align the header of Datagridview. I want the text to be centered in the center. Here’s the code: dg.EnableHeadersVisualStyles = false; // Desabilita formatação padrão…
-
1
votes1
answer180
viewsXmldocument - list all elements?
I have a code XML similar to this : <document> <elemento> </elemento> </document> and the following code C#: (x is a Xmldocument) for (int i = 0; i < x.ChildNodes.Count; i…
-
1
votes0
answers295
viewsRequest Not Authorized or Over Querylimit' - Googlelocationservice
Follows code: var locationService = new GoogleLocationService(); var point = locationService.GetLatLongFromAddress("Rua Osasco - Amador Bueno, Itapevi - SP, Brasil"); Error: System.Net.Webexception:…
c#asked 7 years, 1 month ago Matheus Miranda 5,375 -
1
votes0
answers30
viewsCan I connect Birt Reports to a c#application?
I have a c# application in which routines feed the database. I would like to use Birt Reports to display reports of the information present in the database. Is there any way in the c# application I…
c#asked 7 years, 1 month ago Luca Cariolin 11 -
1
votes1
answer488
viewsNotification with C# Framework, is it okay?
I wonder if you have a way for me to use hub notification or other type of notifications with the C# Framework? If there’s a way someone has an example?
-
1
votes1
answer378
viewsForce user to select Radio Button inside the Groupbox
How do I force user to select a Radio Button inside the Groupbox. Example of the image below…
-
1
votes0
answers338
viewsHow to create a Checklist in trello using the Trello.net Edge library
I am trying (unsuccessfully) to use the library Trello.Net Edge to create a Checklist in a given card. The problem is: whenever I try to create the checkilist an error is returned saying that the…
-
1
votes0
answers64
viewsHow to organize UI needs in the DDD
Where I put the code that does not concern the business rule, but is a necessity for the presentation to the user, such as filling out combobox, dataTables, texboxAutoComplit...? details: Currently…
-
1
votes1
answer448
viewsSingleton standard
I am creating a project in C# and WPF, and I need to control instances of WPF windows, IE if I open a window in a code part with wndJanela.Show(), I want that when calling the Show() method again…
-
1
votes0
answers38
viewsHow do I remove 3 special characters in a string variable, using regex?
Language used is c#, how do I remove 3 special characters in a string variable, using regex? example: (11) 2134-2135 expected result: 112132135…
-
1
votes1
answer93
viewsTransactionscope with multiple Storedprocedures
I’m thinking of implementing TransactionScope in my code, however, all bank access is made by StoredProcedures. The TransactionScope can give rollback in multiple actions carried out in…
-
1
votes0
answers255
viewsSortedlist launches System.Argumentexception exception
I’m trying to implement a code to find the best path in a graph. I was able to develop the recursion method and now I’m trying to implement using stack. The problem is that I get an exception when I…
c#asked 8 years, 5 months ago Tiago Dall'Oca -
1
votes1
answer540
viewsRoutine to clear checkbox from listview C#
I created a small routine to clean the checkboxes that are in my listview in C# windows Forms. But this routine is not unchecking them. I wonder if I wrote something wrong or why it doesn’t work.…
c#asked 7 years, 1 month ago user93952 -
1
votes0
answers250
viewsDifference in using clause using within namespace
There is some difference in performance / execution / compilation of C# code when using clauses using inside the namespace? Basically what I want to know is if there is a difference (beyond…