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
-
2
votes0
answers36
viewsUsing Nlog with Postgresql C#
I am working on an application, and have some log screens, and I want to add a log routine in the API of these records, type: do not add, update and error occurrences (if any). The database that is…
-
2
votes1
answer299
viewsAdding proxy settings in Chrome browser with c# and Selenium
I need to open the Chrome browser with Tor proxy settings using selenium. I was successful with firefox but it’s not very agile, so you need to use Chrome. The problem is I don’t know how to apply…
-
2
votes1
answer1298
viewsError: Configuration system failed to boot
I am developing an application in C# and during development I came across the following mistake: In the archive: Settings.settings there’s a string which stores the user name. Apparently this may be…
-
2
votes1
answer128
viewsProblem with graph c#
Good morning guys, I’m developing a program in which should be plotted several line graphics(x,y) on the screen, the y axis corresponds to serial port where is connected an Arduino UNO. As an…
-
2
votes0
answers80
viewsHow to map entity using Dapper with postgres
I’m having a big challenge here and I can’t seem to solve it. I’m working with DDD and on the layer of Infra esotu using Dapper When trying to execute the following code on RepositorioUsuario:…
-
2
votes1
answer284
views"C#" - The parameterized @image bi query expects the @image parameter that was not provided!
Guys, I am creating a cash system and in the change the registration part the program gives the following error "The query parametrized @imagem bi expects the parameter @imagem that was not…
c#asked 5 years, 9 months ago Bruno Vasconcellos 21 -
2
votes1
answer73
viewsHow to open a Form( or hide a Form) inside a Panel by another Form
I have an application in C# and I wonder if it would be like when I press the add button (whose arrow is pointing in the image) this form that is in light blue inside a Panel if it closes and opens…
-
2
votes0
answers40
viewsCustom line chart
Good morning, I am developing a program in c# that should draw a line chart(x,y) in a picturebox(pcbANALISE) according to the data I have in a list (aquisicaodata[ ]). This chart also has a scroll…
-
2
votes1
answer97
viewsReturn the smallest value using the Entity Framework
I’m quite inexperienced, that’s true, but I’ve grown a pair and I’ve come here to ask.. I’ve been stuck for a few hours on a solution that apparently would have everything to be simple, but I can’t…
-
2
votes1
answer133
viewsWhen Maximize a wpf page c# it overwrites the windows taskbar
I am creating a project in wpf and needed to replace the buttons minimize, maximize and close, follows condition used: if (sender == checklist.btnMaximizar) { if (WindowState ==…
-
2
votes1
answer1566
viewsError: The provider 'ORAOLEDB.Oracle' is not registered on the local machine
Error: The provider 'ORAOLEDB.Oracle' is not registered on the local machine. I need to do some maintenance on a project. NET , with Oracle 12c version and my operating system is 64bit Windows 10…
-
2
votes1
answer60
viewsError picking web service return variable
I have a variable that I return that is of the type x509Certificate2, But once you get back into the system, it always comes null, but from the webserver, it returns perfectly, I’m not sure how to…
-
2
votes1
answer41
viewsHow to implement progressiBar in FTP download
I need to enter the download transfer rate by FTP on progressBar of my Form with the code below: private void Download(string filePath, string fileName) { FtpWebRequest request =…
c#asked 5 years, 8 months ago Marlon Pereira 465 -
2
votes1
answer60
viewsCalling C# method in C
I am trying to import a DLL generated via C# in C. I’m using the methods LoadLibrary to load the DLL, but when using the GetProcAddress the return is always null. I used the GetLastError and the…
-
2
votes1
answer811
viewsSend error message to user (ASP.NET MVC)
I have the following situation: in my controller MovementsController got an action Details who is responsible for performing a database search through the Id received. The question is: if no data is…
-
2
votes2
answers211
views -
2
votes1
answer125
viewsNull ajax values for controller
I’m getting values null on the subject by parameter no controller of asp.net core via ajax Follows the javascript with the ajax var ClienteFornecedor = { Id: "0", Tipo: $('#selTipoAdicionar').val(),…
-
2
votes2
answers73
viewsUse standard Form instance in another class
This is my class HotKey public class HotKey { private string nome; public HotKey(string nome) { this.nome = nome; } private void Start_KeyPressed(object sender, KeyPressedEventArgs e) {…
-
2
votes1
answer179
viewsHow to change not only the style but the cell format with C# using NPOI?
when I file in Excel using the library NPOI (https://github.com/tonyqus/npoi/tree/master/examples/xssf) I can change the style of the cell to moneyFormat with the following code, however, when the…
-
2
votes2
answers177
viewsConverting (Mapping) a List of an entity to another reference explitically
How do I convert/map a list from one entity to another reference explicitly. Here’s an example I was able to perform with an entity: public static explicit operator UserResponse(Entities.User…
-
2
votes2
answers113
viewsSplit phone number that comes from an html file and split it in two
I receive a numeric field in a html that comes like this "413232123441999993254" which in this case would be two phone numbers with DDD 41, both enter the Phone: field, I would like to divide these…
c#asked 5 years, 8 months ago Fagner Gonçalves 21 -
2
votes0
answers75
viewsHow to reuse the same browser in a test suite with Selenium and c#?
Every time a test suite is started the Openbrowser method of the Tbbrowser class is started and a new browser is opened, I wanted to reuse it, it is possible? ublic class Tbbrowser { public static…
-
2
votes0
answers25
viewsDoes not log in after published in Azure
I need help.. I published a web application, developed in ASP.NET MVC5 with c#, on the Azure platform. This application has implemented an authentication system. The application works well locally…
-
2
votes2
answers67
viewsHow to know if all Abels with numbers are filled
I have a card with randomly generated numbers that when they are equal to the number generated in the middle, make the orange Labels. However, I wanted to do something for when all the Abels with…
c#asked 5 years, 8 months ago D. Rodrigues 79 -
2
votes2
answers79
viewsDetecting if a Setter of a property has been called
Hello I wonder if there is a way to find out if the value of a property has changed. Example public partial class MinhaClasseExemplo { public int Id { get; set; } public String Nome { get; set; }…
-
2
votes1
answer40
viewsNull Arriving Object List in Controller
I have a question and hope that someone can help me. I am not being able to send objects from my View to the controller. Every time it comes, it’s empty. I’ve tried a lot of things and I can’t seem…
-
2
votes1
answer78
viewsAdd Checkbox to Datagrid field
I have a DataGrid and I’m wanting to put in a field a CheckBox, was researching and it seems that with the .EditorOptions() it is possible to do this, but do not know how, just passing CheckBox as…
-
2
votes1
answer267
viewsC# Windows Forms Calling a Grandchild Form inside a panel in the Grandparent form from the Parent Form
I have 3 forms, Main, product and details. In the main form I have a side menu and a panel called pnlContent. In this menu I have a button that fills the pnlContent with the product form. Inside the…
c#asked 5 years, 7 months ago Luciano Martins 23 -
2
votes2
answers395
viewsHow to assign a default date on a Datetime type object in C#?
I created a class called Order, and in it I created a field for the purpose of entering a date of delivery of the order. But I created the object on Main(), and at the time I execute it fills in…
-
2
votes2
answers99
viewsValidation with Dataannotation
I want to do a validation with the size of a field of the type int using Dataannotation, I used [MaxLengthAttribute(10)], only at the moment that I will make the View Index to bring up the list of…
-
2
votes1
answer165
viewsLike search with LINQ using array
Context: I have the following form: On this screen the user can filter materials by some of their properties. The filter highlighted in the image allows users to search for one or more manufacturing…
-
2
votes0
answers974
viewsScreenshot me returns the error index was Outside-the Bounds of the array
I have a screen that saves users, and assigns value to them, but whenever I click the save button it returns me the index error was Outside-the Bounds of the array , I already searched lines and…
c#asked 5 years, 7 months ago Lucas Tadeu Egídio Arruda 281 -
2
votes1
answer93
viewsAlternative to IF and Else in a specific problem
PROBLEM I have stored in the database five types of data sets, different from each other. Imagine, to illustrate, that this data set is details of five different fruits, for example, bananas,…
-
2
votes1
answer260
viewsC# - Run Oracle Procedure and then select from the created session table
Hello, I’m trying to do the following. I have a database that performs a select and inserts the data into a table that only exists in that session. I need to run this trial and then refer to the…
-
2
votes2
answers93
viewsNo constructor without parameters has been defined for this object
I am creating an endpoint in an api and when a method request is made the API returns the error "No constructor without parameters has been defined for this object." even though a builder has been…
-
2
votes3
answers204
viewsUpdate app.config or web.config via code
I am developing a robot that reads all lines of various files contained in a folder. But I need to know which was the last file and line read so I can resume when I need to. I thought I’d put it in…
c#asked 5 years, 7 months ago Leonardo Bonetti 5,313 -
2
votes1
answer182
viewsHow to pass data from a View to a Model
I searched a lot on Google and Youtube, but I didn’t find anything very clear(I might be searching wrong too). I’m new to Asp.net, and wanted to pass the data from this form (Works.cshtml) to the…
-
2
votes1
answer147
viewsOut of Memory when placing image in Picturebox c#
I’m trying to open a JPG, PNG, BMP or TIFF image on PictureBox, but when I try to put this image, which was opened earlier, gives the error of "Out of memory". My code is to open the image and put…
-
2
votes1
answer56
viewsError generating class c# from XSD
Guys, I’m having to change the XSD version of my application, because the ANS has now made it more flexible to send the SIB to the SIB FLEX. Link to the XSD:…
-
2
votes2
answers197
viewsHow to open external process on second Monitor
I need to open an external program to stay in the second screen. I need it to be exactly embedded in the second monitor. Let’s say I want to open the notepad, I don’t want to open it on the first…
-
2
votes1
answer54
viewsHow to lock a method so that others do not call while it is used?
I have a simple method of log, which adds some lines to a special file. The problem is, the application is multi-threading, and in each Thread is called this method to log, and when one is called,…
-
2
votes3
answers561
viewsValidate if a CPF already exists in the List before inserting C#
Good evening, I am creating a sales system (college work) that has a simple registration of Clients (name and Cpf), we are working with the Project in layers, I am having difficulty because I am…
-
2
votes1
answer40
viewsHow to implement dictionaries in the Multithreaded Singleton standard
The pattern Multithread Singleton serves me in order to enable the use of "global variables" in my application. Its use occurs through the resources of get and set, as it is possible to notice. How…
c#asked 5 years, 6 months ago Caio de Paula Silva 1,189 -
2
votes1
answer52
viewsParameter is not Valid - Picturebox in C#
I am making a TIFF file viewer in Visualstudio 2017, in C#language. I can open the TIFF file, if multipage will separate it by pages and I can show each page and browse through them. My problem is…
-
2
votes2
answers119
viewsHow to shuffle a list of objects through a default value?
I have the following object: public class Object{ public String ID{get;set;} } And in a moment in my code I get a list of them: List<Object> objs = new List<Object>(); objs.add(new…
c#asked 5 years, 6 months ago Leonardo Bonetti 5,313 -
2
votes0
answers80
viewsPopulating an Existing Datagridview
Guys I have the following problem, I have a datagrid, in which I would like to insert more lines in it. - When the record is new Grid accepts normal, but when I edit it, it reports to me:…
-
2
votes1
answer43
viewsC# How to pass service and model to a search window
Hello, I have the following situation. A CRUD form calling another form (common or generic) to search for records... private void barButtonItemProcurar_ItemClick(object sender,…
-
2
votes3
answers101
viewsC# Object reference not defined for an object instance
Who can help me and explain this problem I will be grateful using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BuscaLargura…
c#asked 5 years, 6 months ago Pedro Pacheco 17 -
2
votes1
answer400
viewsGrab URL directly from an image of my ASP NET MVC application
Good afternoon, I’m trying to make an API to return the URL of an image list but I don’t know how to do it. I found things with server.mapPatch but these return the physical address of the file. I…
-
2
votes2
answers2049
viewsVisual Studio and Github - Which files to ignore (C#)
Hello! I’m studying C# and created a repository on Github to save the exercises. When starting a new project, Visual Studio Community (2017) creates the following structure: PastaDoProjeto/…