Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
0
votes0
answers308
viewsUpdate . NET Framework for a version larger than 4.0
I opened a request for the IT area to update my website to version 4.5 or higher of . NET Framework. They said the server has version 4.5 already, the problem is that my site keeps returning the…
-
0
votes1
answer232
viewsHow to limit decimal places in C#
I made an application to calculate the arithmetic average of 3 notes. My form has 3 Textbox that receives the note and a button that calculates the average. The result is printed on a Label, as I do…
-
0
votes1
answer94
viewsFill GRID with JSON - Deserialized (Metrogrid - Metroframework)
I’m probably doing something wrong, and I must have made a mistake doing the loop, but come on. I have a class called 'Class.Cs' that has the following code: [JsonProperty("A")] public string A{…
-
0
votes1
answer39
viewsButton to enter Records in Database
Good, I am conducting a project for my PEF that consists in creating a Database for a company. However, I decided to put a button to add records and when I click to add, the following error appears:…
-
0
votes1
answer30
viewsButton to enter Records in Database
Good, I am conducting a project for my PAP that consists in creating a Database for a company. However, I decided to put a button to add records and when I click to add, the following error appears:…
-
0
votes0
answers71
viewsDoubts about fetch
Good afternoon, you guys! So, I’m new to the stack, it’s a pleasure. I created an api on. net core for studies, and I’m creating a POST method but it doesn’t work at all, not even add to my JSON, it…
-
0
votes2
answers137
viewsFormat date to dd/mm/yyyy using Datattables. Netcore
In my project I’m using the library Datatables for mounting of my tables, the problem is that it is returning the date in the standard american (format I write to the database) and am unable to…
-
0
votes0
answers23
viewsDoes . NET have a host type or management service?
I see in Windows that when I run an application, only one process appears in the task manager. But the apps are not native assemblies. In JAVA the Host is the JAVA itself. Is there some kind of host…
.netasked 4 years, 5 months ago user178974 -
0
votes2
answers153
viewsC# convert dynamic string to xml with TAG
I would like to know how to convert a string with XML inline to an XML with tags, I am using Xmldocument, I have the following code: var MihaString="<MeuXML Info01="teste 0121245"…
-
0
votes1
answer20
viewsC# Define page orientation for a Webbrowser control
Hello. Referent: Windows Forms. I have a Webbrowser control on a form that is displayed to the user. This Webbrowser displays an HTML document in its Documenttext property. I can display the form…
-
0
votes0
answers272
viewsAdd Reference to Visual Studio 2019
I used Visual Studio 2017, and had an area to add reference. When I switched to Visual Studio 2019, I noticed that the button changed its name. When I try to add a reference it doesn’t work, the box…
-
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
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
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
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
votes1
answer213
viewsError installing . NET Core on Linux Mint
When trying to install . NET Core on Linux Mint using Snap command sudo snap install dotnet-sdk --classic, at the end of the package installation, it is displayed: "dotnet-sdk 3.1.401 from Microsoft…
-
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
votes0
answers56
views'Undefined object reference for an instance of an object. ' Datagridview.Currentrow
System.Windows.Forms.DataGridView.Currentrow.get returned Nothing. Me.StatusTableAdapter.Fill(Me.DataSet1.Status) Me.FornecedorTableAdapter.Fill(Me.DataSet11.Fornecedor)…
-
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
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
votes0
answers32
views: 'The input string was not in a correct format. '
Hello, I am developing a program that collects data entered by the console in c#, however, I come across this problem when I enter a value other than’s' here char entry = (char)Console.Read();…
-
0
votes1
answer95
viewsHow to add an icon inside a Textbox using Material Design?
I installed the Material Design Xaml package in my project, but I have a question of how to create an icon in Textbox. I have the following code: <StackPanel> <TextBox…
-
0
votes1
answer26
viewsMultiple pages with report RDLC C#
I’m using rdlc for reporting. I upload and retrieve the required data from a csv (collaborator, enrollment...). Within my routine while, I am using the following code to override the parameters of…
-
0
votes0
answers17
viewsWCF - Bool returns Void
Hello, good morning, good morning! When I call the WCF service on the client side, a function that was made to return bool is returning void.. and even asks for more parameters than those indicated…
-
0
votes0
answers61
viewsC# - Manipulation of controls in event triggered by a multithreaded method of another class
Good morning, you guys. I’m developing a C# library using Visual Studio for software authentication/licensing. It’s something simple. It basically consists of a method that executes a continuous…
-
0
votes1
answer55
viewsFill PDF checkbox with iText7
Hello! I’m trying to check a checbox of my PDF, but I’m not getting it right. Instead of just checking one of the checkboxes, he’s always checking all 3 What I would like: What I am getting: PDF in…
-
0
votes0
answers24
viewsApplication . net does not create service in windows (sc create)
I have the following code: public static void CriarServico(string nomeServico, string caminhoExecutavel) { try { string arguments = string.Format("create {0} binPath={1} type=own start=auto",…
-
0
votes1
answer70
viewsWrite to new column of a csv file using Stringbuilder c#
I saw an example of code right here in stackoverflow where I use the example below to write a CSV file using stringbuilder: public void ExportarCsv(List<Result> erros) { string filename =…
-
0
votes1
answer65
viewsHow to generate a PDF from a string
After making an HTTP request to an API that promises to return one: "nrwexPDF" I have the following return: "%PDF-1.2 \r\n1 0 obj\r\n<<\r\n/Type /Catalog\r\n/Pages 3 0…
-
0
votes1
answer42
viewssqldatetime overflow c# When trying to use type = Date in Razor Using . NET MVC
When trying to save a change from a client, the SQL Server database is returning the following message: Sqldatetime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. View:…
-
0
votes1
answer31
viewsI cannot return ID when entering data via ASP NET Controller POST
I have the code below, and I need the ID returned as soon as I insert the object. If there is already a registered project, it does not do the insertion, but I need to return some data as empty or…
-
0
votes0
answers19
viewsMultiple requests for an API result in 500 Internal Server error
I have an API that makes two requests on Microsoft services (POST and GET) that receive a code and bring some information about employees. public async Task<string> AdquirirEmail(string…
-
0
votes0
answers24
viewsError in an MVC application using foreign key with Mysql
I cannot register an owner who depends on a foreign key Cidadeid Mysqlexception: Cannot add or update a Child Row: a Foreign key Constraint fails (veterinario.proprietario, CONSTRAINT…
-
0
votes1
answer99
viewsGET method returning empty
Good evening, I am developing a Webapi, I am using the code-first approach, for this I have selected the Entity framework 6.0.1, in my project I have the following classes Personcontroller.Cs,…
-
0
votes2
answers51
views"Argued tofrangeexception" error when performing database query to return quantity of records
I have a query in ADO . NET with the aim of return the amount of records I have in the bank based on last month and year. For example, I pass the date "27/01/2021" and receive the amount of records…
-
0
votes1
answer145
viewsGenerate PDF and attach to send email c#
Good afternoon guys, I have a modal, where the user can send an email, in this modal, I loaded a HTML, so that I can generate the PDF and attach to send in the email. But I’ve seen several articles…
-
0
votes1
answer154
views -
0
votes1
answer85
viewsEncrypt and decrypt
I took this code here to encrypt and decrypt a Id of the type `Guid: public static string EncryptString(string text, string keyString) { var key = Encoding.UTF8.GetBytes(keyString); using (var…
-
0
votes0
answers28
viewsHow to use the async function of System.timer.Timers?
I’m trying to deploy an asynchronous timer in my application. NET, so that the Forms is interactive while the back end makes a request and deserializes the answer of it, assembling everything in a…
-
0
votes1
answer59
viewsHow to set hostname in publication Asp net core 3.1 selfHosted
I have a working project which the publication preference is in the format of publish to self hosted folder (selfhosted) (without using IIS). Reason for this: the goal is to decrease the…
-
0
votes0
answers39
viewsC# inserts incomplete text into the database
Hello, I have an application in . Net C# that updates/inserts a text in HTML format in the Mysql database. In my table in the database I have a field of type Longblob that will store this text. But…
-
0
votes0
answers19
viewsError: CTC1014 Docker command failed with exit code 1
I don’t have much experience with Docker and programming, but when trying to run my project. net core with Docker it tries to compile, but after a while it returns the error below: Erro CTC1014 O…
-
0
votes1
answer79
viewsHow to consume Github API on VS2019 avoiding 403 error on all requests?
Somebody please save me. I need to consume the Github API for an internship challenge, but I’m caught in a 2-day problem, the challenge makes it clear that it’s not to use authentications, just use…
-
0
votes0
answers47
viewsError calling endpoint: Exception has occurred: CLR/System.Nullreferenceexception C#
Guys, I’m trying to generate a spreadsheet filled with the data I have from SQL server, I can get that information right but when I call a method responsible for taking that information and…
-
0
votes1
answer33
viewsEF: How to return only a few columns from the database?
I’m having trouble returning a collection of objects from the database with just a few columns selected. I searched several solutions on the web and the vast majority presented the solution below,…
-
0
votes1
answer40
viewsSending File to API with Authorization . Net 5
On my system, I need to send a received form file to an API that will be saved in Azure. For this submission I need to pass a Bearer Token, the part of the token I was able to do and receive,…
-
0
votes2
answers43
viewsHow to deserialize JSON Array in an Object Array?
I’ve been trying for a while to deserialize a JSON return from my nodejs api. I’ve tried many ways and no success. I have the following client request return JSON. "response": { "count": 1,…
-
0
votes1
answer44
viewsI cannot connect to Database in Entity Framework
Good night, I am unable to connect to the database to create the Models folder tables in .NET. When I try to make the Migrations returns this error: "Could not run because the specified command or…
-
0
votes1
answer32
viewsError using Accord.Net package
I’m making a Windows Forms C# application and using . Netframework 5.0 to record and save videos to the computer with a webcam. I use the Accord.Net package for recording. It was almost ready with…
-
0
votes1
answer35
viewsHow to change the Listbox Index to 1?
Citation I would like to add names to a listbox, put a NumericUpDown to associate how many dependent names will be added at most, depending on the number the user enters, and a txtbox to add names…