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
-
0
votes0
answers55
viewsExcept System.Platformnotsupportedexception when trying to compile code with Codedom
I’m using a code, which I saw in a reply of this page: var csc = new CSharpCodeProvider(); var parameters = new CompilerParameters( new[] { "mscorlib.dll", "System.Core.dll" }, "teste.exe", true) {…
-
0
votes2
answers106
viewsHow to order questions randomly?
I’m finishing a project of Quiz Unity game in C#, let me try to explain what I need, I already ask the random questions, but I want the answers to be displayed at random as well. I have a list of 5…
-
0
votes2
answers30
viewsI need to solve an image resizing problem in C#
i am trying to implement a code to do image resizing because currently are uploading very large images on my system, however I am not able to perform resizing proportionally. Follows the code in…
-
0
votes1
answer53
viewsDelete key composed of a table with angular and Asp.net core
You guys all clear? next I’m having problems with composite key in my project and I wanted your help because I’m still not quite sure about it, I’m doing the front in Angular and the backend with…
-
0
votes1
answer44
viewsHELP ME If Condition in a Maskedtextbox
Guys, I know this site is very famous because the community is SUPER charitable and kind. Help me with this: I can’t get a Messagebox to show when I leave my Maskedtextbox blank. I formatted it to…
-
0
votes0
answers95
viewsIs it possible to upload blazor webassembly applications with . net core hosted on Herokuapp via Docker?
When I go up a blazor server application, I use the following steps: I create a dockerfile file in the same folder where the project is so: FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim…
-
0
votes1
answer37
viewsAutomapper - Map a collection of strings to a collection property within a collection
Which doubt ? How to map Idcontributors (collection of strings) to a collection (Contributors), within the Taction collection, with a string property (Contributorid), using LINQ and autoMapper.…
-
0
votes0
answers45
viewsError implementing simple AI in C#
I wonder if someone could help me, if there is a simple example or nuget for AI, which is exclusively in C# for object recognition and OCR reading, using a pre-trained model (Onnx for example). I…
-
0
votes1
answer44
viewsMongodb.Drive fails to filter an Object Array with Elemmatch
I have a document in mongoDB with this training: { "_id" : NumberLong(21), "_t" : "Detail", "DeletionDate" : null, "CreationDate" : null, "UpdateDate" : null, "Accounts" : [ { "Bank" : "123",…
-
0
votes0
answers42
viewsc# winform locking when network drops
I have a windows form system that needs a loop check all the time. The problem that is happening is that when the network falls and this loop tries to connect in the database the screen gets stuck,…
-
0
votes1
answer73
viewsC# Assign a Form to a variable
I’m having a hard time solving this problem. I created a project in Windows Form to open the other forms inside a panel, being that I would like to associate the Forms to be opened in the variavies…
-
0
votes0
answers40
viewstransform wav into byte[]
I need to join three audios. I thought and I chose to turn them into a string of bytes to then concatenate them. However it is giving error in File.ReadAllBytes : "…
-
0
votes1
answer43
viewsHow to use a mask in a dynamic textbox?
I need to implement a mask (value) in n Textbox fields (defined by n periods x n contracts) within a grid, where they are generated dynamically. I use jQuery for static textboxes (Autonumeric). But…
-
0
votes1
answer47
viewsMy if Else doesn’t work on the Console.Readkey, so he was doing a little program he’s running but he "jumps" the commands inside if Else
using System; using System.Security.Cryptography.X509Certificates; namespace projeto { class Program { static void Main(string[] args) { Dados a = new…
-
0
votes0
answers34
viewsClass byte for C#Image Storage
I am new in programming I am creating an application for Hotels and in this application we will have several images for each hotel, I created the following code: public class hotel : BaseClass…
-
0
votes1
answer59
viewsDll Delphi Using on C#
Hello, I’m trying to integrate a dll made in Delphi 10.1 and use its functions in C# however it even accesses the dll but the application CLOSES without giving any error, I will pass as I am doing.…
-
0
votes1
answer30
viewsC# - Receive data via serial and pause receiving
Hello I am developing a software in C# that receives data via serial communication, everything is working but I have a little problem. My software receives the data via serial and displays in Text…
c#asked 4 years, 3 months ago user171274 -
0
votes1
answer32
viewsHow to avoid using Service Locator in my Unit Of Work with Delimited Contexts and Mediatr?
Hello, I am starting studies on Ddds and delimited contexts and would like to avoid the use of Service Locator to access my repositories through the Unit of Work. I am currently using Mediatr to…
-
0
votes2
answers40
viewsHow to do JSON function return Monthly amount of liters fueled in one year period
The function should return this Example: { "January": 500.00, "February": 514.00, ....} My table has the following fields. Km of supply Liters Abastecidos Valor Pago Date of supply I developed an…
-
0
votes1
answer148
viewsC# - Cannot convert an object of type 'iTextSharp.text.pdf.Pdfarray' in type 'iTextSharp.text.pdf.Pdfdictionary
I’m developing a certified digital signature system A1 and A3 (token) for pdfs along with iTextsharp (v5.5.13.1, via NuGet Package Manager). I use the c# and I came across the following error in…
-
0
votes1
answer69
viewsManipulate Date in ASP.NET
I’m starting to learn ASP.NET and can’t find solution to the case below: I have an instance of Datetime where I do the conversion to "ddMMyyyy" format using Parseexact(), to show the date without…
c#asked 4 years, 2 months ago goldenleticia 543 -
0
votes0
answers69
viewsTest in anonymous window on Seleniumwebdriver
I’m trying to get Selenium to run the tests in Firefox’s private window, but the execution is still done in the default window. Something is missing? private IWebDriver driver; public…
-
0
votes0
answers70
viewsHow to optimize access to the Database?
I’m doing a project where I often need to access the database to do things like: Load User Data (Example: Balance, Settings); Upload images; Insert/Update data. It’s a pretty boring process to have…
-
0
votes1
answer24
viewsIs it possible to sign a lib event on a REST request and wait for the return?
I wonder if it is possible to sign an event from a third party lib, which in the case is Microsoft.Speech.dll. Because, in my attempt, it did not work very well, ie, recognition does not happen and…
-
0
votes0
answers75
viewsError when implementing Swagger
I am trying to implement Swagger in my application but I got the error by uploading the application I did it by following the microsoft documentation, but, I did not succeed. It seems a very generic…
-
0
votes0
answers19
viewshow to place date and time on [Datatype(Datatype.Datime)]
Gentlemen, I’m trying to make it easy to enter date and time data for the user,. my class was like this Link >from my class "Query" https://dotnetfiddle.net/ZHPHKK (as the link and image does not…
-
0
votes1
answer22
viewsInclusion of data/ object
I am having a problem in including objects from other classes. What would be the best solution for this? For example, I have a Service class and attributes that are other classes, such as Customer…
-
0
votes2
answers59
viewsSerialize to different objects in C#
How I have to create my class in C# to be able to serialize this json that comes in a request for my API? [{ "name": "campo_normal_1", "value": "valor do campo 1 normal" }, { "name":…
-
0
votes0
answers23
viewsNhibernate with list of objects changing objects linked by FK
A Document has a Items list mapped with Cascade all (when saving the document, items must be saved). Each item has a reference to the FK of the previously registered product. When opening the…
-
0
votes1
answer43
viewsProgram error of average in C, in result view
I’m a beginner in C programming, and in college we had to develop a program to make the average of 4 notes, and after typed, make the display, the program works without syntax error, but there’s…
-
0
votes1
answer204
viewsCall a function that returns an array C#
I need the user to enter a number that will be the amount of numbers to be calculated, for example: if I type 4, there will be 4 different numbers to do a given action (add, subtract, multiply or…
-
0
votes2
answers210
viewsError trying to access ASP NET MVC page C#: "HTTP 404. The Resource you are Looking for (or one of its dependencies) could have been Removed"
Hey, guys, a problem I can’t seem to solve. My project is ASP NET MVC5 with C#. I went to create another page in my project and simply when I run it is not recognized. I did the same way I always…
c# asp.net-mvc asp.net asp.net-mvc-5 visual-studioasked 4 years, 2 months ago Rafaela Marraschi 123 -
0
votes2
answers233
viewsGet data from a website to use in C#
Good night, I’m a beginner, and I’m developing a C# program in Visual Studio for my TCC, this chunk of code I’m having trouble with will get the data from a table of a website and after storing it…
-
0
votes0
answers16
viewsError in exporting XLS to Webforms projects
good night! I am trying to export the dataset to error when trying to generate XLS: System.Indexoutofrangeexception: 'Unable to find table 0.' DataSet ds = new DataSet(); protected void…
-
0
votes0
answers22
viewsOracle 19 User Interface Authentication using ODP.Net Core
We are developing an . Net Core 3.1 application that connects to an Oracle 19 database. During authentication with an Oracle User Enterprise we are receiving the following error: "ORA-01017: invalid…
-
0
votes1
answer32
viewsHow to filter a database item through a List field?
I have the entity MessageEntity which contains several sessions (SectionsEntity) which in turn contains several calls (TreatmentEntity). I need to bring the messages, filtered by your Id, filtered…
-
0
votes1
answer71
viewsGroup By select
I have an Employee table with the fields Name, Age, Gender and Company. And each employee may or may not be in more than one company. With that I made the following select in this table. select…
-
0
votes1
answer89
viewsGenerating Logs with Line Error and File Error (C#)
Eai guys, I’m trying to generate Logs for a web application. ASP, however I cannot find the correct C# method to find the Line and File where the error is occurring. Within the exception I found the…
-
0
votes1
answer30
viewsHow to return a file to the client?
I need to return a file in my action so that the client can download it. In my current code, the file is being saved on server. [HttpGet] public JsonResult ExibirPrintRPA(int? id) { string _nameFile…
-
0
votes1
answer25
views -
0
votes1
answer92
viewsHow to convert XML field to decimal
When reading an Nfe XML I read fields that in my system are decimal, for example qCom (Quantity), vUnCom (Unit Value) and vProd (Product Value), but the XML file uses the point as decimal separator,…
-
0
votes1
answer26
viewsExcel VSTO: Iterate cells according to their properties
I’m doing an Excel Add-In in Visual C# (VSTO)... I wanted to iterate on the cells of a selection (which may be discontinuous) that are not "Hidden" (hidden). This selection may be large. So, if you…
-
0
votes1
answer142
viewsHow to assign a value to a select option (HTML element) and display data associated with that value? ASP.NET
I have a select that is being 'populated' as follows in my ASP.NET application: <select id="id_select" class="form-control"> @foreach (var x in listay) { <option value = "@x.nome">…
-
0
votes0
answers51
viewsIs this code appropriate or a bad practice?
Good afternoon, I am a beginner in programming and in case my problem would be with C# and Windows Forms. I have a screen for reports of a PDV system, and in this report I can select the daily,…
c#asked 4 years, 1 month ago Kamehameha 49 -
0
votes1
answer90
viewsLogin method that receives user data
I’m doing a project and trying to create a simple login method I have the following class User public class Usuario { public int Id { get; set; } public string Nome { get; set; } public string Login…
-
0
votes1
answer249
viewsConsume Web-Service via WCF with digital certificate
I am developing an application that needs to use a Webservice (WSDL) from a third party company. To access this WSDL I need to use a certificate.pfx. I have already installed this certificate on my…
-
0
votes1
answer35
viewsJsonconvert.Deserializeobject is not reading the value of my json. (Values returning to null)
I am trying to read a simple json file that will possess the path to some audio files. Nothing complicated. Follow below the json: { "audioSetup": { "buttonNumpad1AudioFile":…
-
0
votes0
answers31
viewsHow to load references before performing Insert?
I have a method that receives Id parameters. These are, referenced in a model, however, I need to be loaded your references before saved, because I need this information to communicate with a API…
-
0
votes0
answers19
viewsMultiple Dropdownlist
After doing a lot of research in the documentation and checking right here at Stackoverflow, I decided to ask. My question is the following I created two Dropdownlists. View as it is now:…
-
0
votes1
answer119
viewsEffect of fading Windows window to (Minimize, Maximize and Close)
I left the WindowStyle="None" and that eliminates all the animation of the window. A normal window edged has the excitement of fading to the (minimize, maximize and close). I wish that same effect…