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
answers26
viewsNpgsql.Postgresexception: 53300: remaining Connection slots are reserved for non-replication superuser Connections
I am using Dotnet Core and C# to fetch data from an API and saving to a Postgresql database. And arrives at a certain part of the process in which this error appears: Exception has occurred:…
-
0
votes0
answers16
viewsHow to sort a model
I am having difficulty making an ordering, because I return an object and within that object, I have a list of another object and that list needs to be ordered by a property. The point is, when I…
-
0
votes1
answer38
viewsHow to improve a calculator
I wonder if we can make this code not stop when I type a letter instead of a number, just correcting and telling to type a number. namespace calculadora { class Program { static void Main() {…
-
0
votes0
answers15
viewsCommand only works if you edit the code while the program is running
Xaml <ItemsControl ItemsSource="{Binding Foldres}" FontSize="14" Foreground="{StaticResource SecondaryTextColorSolidColorBrush}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"…
-
0
votes1
answer60
viewsDefine Entity Account in dotnet
Hello, I have to define an Entity Account for a microservice of retail software. An Account can be the type: Individual Familia Enterprise Being the type individual is composed of the traditional…
-
0
votes1
answer22
viewsSave data from a datagridview to a database
I am wanting to save more than one line of my datagridview in the database, but it saves only the first line and after the error saying that the parameters have already been set, wanted to know…
c#asked 3 years, 4 months ago user247153 -
0
votes0
answers28
viewsWrite data from two Datagridview to the Sql Server database
I’m not able to record the data that are in two dataGridView, the data that are in the two Datagridview are in a single Class, I have a code ready but would serve only for a Datagrid, in the same…
-
0
votes0
answers16
viewsHow to use sockets to upload a . txt file to the server and on the server receive that file and save it to the directory?
I’m three days trying to understand how this works and looking for examples, it turns out that most teach how to send text messages or chats between server and client, besides I’m not using windows…
-
0
votes1
answer22
viewsC# Month Combobox - Setting Selecteditem
I have to create a Combobox only with the months of the year to handle the system’s paying bills. So far so good, the problem is that the client wanted to be selected the current month in Load. I…
-
0
votes0
answers11
viewsSectiongroup (XML) data - Dotnet Core
I need to search "sectionGroup" values, as I had to do several sections, it is necessary to use it, however, when trying to search, the value always receives Error. Knowing that There is no…
-
0
votes1
answer34
viewsGet JSON file from an API
I’m beginning to understand about API but I’m having a great difficulty because I’m trying to consume a JSON from an API according to the code below: HttpWebRequest request =…
-
0
votes1
answer25
viewserror with Insert and mysql
I have the following method: public byte[] CarregarArquivoImagem( Int64 idVenda,string nomeArquivo, string caminhoArquivo, int ImagemTamanhoMaximo) { string query = null; MySqlDataReader reader;…
-
0
votes0
answers17
viewsRTD (COM) / communication error. Connectdata(Int32 topicId, Object[]& Parameters, Boolean & newValue)
I created a client to communicate with RTD server, my knowledge is small in C# I have higher in JAVA, but I did not find anything likely to use in JAVA, I am using this example of client c#: using…
-
0
votes0
answers16
viewsWhy can’t I handle errors when mapping tables?
How can I improve error handling when mapping tables/views? I already solved the error, but I need to e-mail a message with details of the error, as it is not Code First, I end up having these…
-
0
votes1
answer26
viewsUnit Testing Entity Framework Core
Hello, I am starting a project and it is the first time I work with unit test, we are trying to perform unit test in EF Core, but when testing the Get, I am not able to get the value of…
-
0
votes1
answer19
viewsConvert generic to specific type in DB set
I am creating a web api using . net 5 The purpose of the application is to make a simple user registration, and in the future other types of registration I created a generic CRUD interface to be…
-
0
votes0
answers26
viewsError signing Sisobrapref XML document - Invalid Transmitter Certificate - C#
Every time I send a document . xml to Webservice returns me the following message: "Invalid Transmitter Certificate" I am following the following documentation: Documentación Sisobrapref Someone can…
-
0
votes0
answers26
viewsError recording video and audio with Accord.Net - Winforms C#
I am working on an application that should record video and audio through a webcam. I was able to make the program run only with the video, but when trying to add the audio I am getting an error. I…
-
0
votes0
answers10
viewsHow do I change the return of a method (Webmethod) in ASMX?
I developed an ASMX with a method, and when executing the code on the return of this method, it mounts an XML from a certain class defined by an XSD Schema, which however comes a TAG with suffix…
-
0
votes0
answers35
viewsHow to set up a WEB application developed in C# ASP.NET (.NET Framework) for a server configured in Medium Trust?
Guys, I’m having the biggest headache to host a website, developed in C# ASP.NET (.NET Framework), MVC, on the server of LOCAWEB. Their server is set to Medium Trust and their confidence level is…
-
0
votes1
answer20
viewsHow to change the value of a textbox by another form? c#
I have two forms: 'Sales' and 'productsDaVenda' and a general variable that is in the code as Unique_home.Program.vendas.preco: public static class vendas { public static string preco { set; get; }…
-
0
votes0
answers18
viewsSend content from an index to an Edit via AJAX with . NET
I’m creating an approval screen and when the user clicks fail will appear a pop-up to describe the reason for the refusal ... The problem is that I am not being able to send via AJAX the information…
-
0
votes0
answers17
viewsClose Window when Thread finishes c# wpf xaml
How do I close the Window after the thread runs ? This error is given: System.Invalidoperationexception: 'The call thread cannot access this object because it belongs to a different thread.'…
-
0
votes0
answers13
viewsError dehydrating Property value for Entities.Mesa.Mesastatus
I mapped the classes Mesa and Mesastatus with Fluent Nhibernate, according to the code below: CLASS public class Mesa { public virtual int MesaId { get; set; } public virtual int Numero { get; set;…
-
0
votes1
answer63
viewsConvert string to a C class #
I am doing an integration with an API in SOAP, in one of the methods need to pass as parameter a value of an API class, the problem is that I receive this parameter in the format String and need to…
-
0
votes0
answers18
viewsAjax request using Asp . net core
I’m having trouble with this request... It’s returning 'not been' on the console. The getValue() method is in the Controller/Homecontroller.Cs /* JS */ var obj = { emails: 'teste' } var json =…
-
0
votes1
answer17
viewsWhy doesn’t my Progressbar increase values?
I have an application in Winforms where I have Tasks and in each task I implement statically a value there progressBar, I would just like to know why it does not show this evolution in winForms Ui.…
-
0
votes1
answer16
viewsTreeview How to Remove Color from the Background of a Node After Click
When the component was clicked but my intention is to remove this color blue half red if you use the zoom will notice these two color I’ve tried all kinds of things but click it gets this color…
c#asked 3 years, 3 months ago TAVARYS tavares 1 -
0
votes1
answer22
viewsThe type of entity requires a primary key to be defined
I am creating a web api using the .net 5 The purpose of the application is to make a simple user registration, and in the future other types of registration I’m using an architecture DDD, and in my…
-
0
votes0
answers22
viewsPrint elements of a data grid view, using C#print Document
Hello, good afternoon ! I am doing a small project of registration and sales of products and I have a problem in my sales form. Initially the form searches the data of a product that is in the…
-
0
votes1
answer37
viewsUse of attributes in C#
I am facing a situation where in a large part of the methods of my API I need to send a request for another API to account for calls and so invoice them. Currently this code is contained in these…
-
0
votes0
answers25
viewsArray return in C#
When I assign a function that returns an array to another array, I do not have the corresponding values of each index as assigned within the function. I need to return three percentages that are…
-
0
votes1
answer17
viewsRow position and column that was clicked inside the Richtextbox
I have a simple application that only reads a file and returns what is in it within a richtextbox. The Point is when I click on the inside of the richtextbox, I would have to turn to the position of…
-
0
votes0
answers28
viewsQueen`s Attack II Hackerrank - C# - Terminated due to timeout
Good afternoon. I made the challenge of Queen’s Attack (I started programming a few days ago) and I can’t get 100% approval on this challenge. It’s said that my code needs to be optimized, but I…
-
0
votes0
answers14
viewsChange Connection String at runtime - changing each request to the API - EF Core
I need to create something that changes my connection string at runtime... In my WEB API (.net 5) Every request that is made needs to be contained in the Request Header 2 parameters, Authentication…
-
0
votes0
answers17
viewsJsonconvert decimal values with error
I am consuming a Json api with C# Xamarin so far so good, but I have a problem in the deserialization of a Json with decimal values, the return of the api is correct (Json highlighted below the…
-
0
votes1
answer16
viewsChange property value depending on your type
In my Rest application I receive values via json that are converted to a class My endpoit [HttpPost] [Route("Pessoa/Adicionar")] public JsonResult AdicionarPessoa([FromBody] PessoaCommand body) {…
-
0
votes0
answers4
viewsResponse time of one or more actions C#
I’m developing an app in windowsforms in order to create a personal assistant and I’m having a hard time limiting her action. The problem is that when I start the voice identification process:…
-
-1
votes2
answers4499
viewsSave images in repository and recover it through a Path with C#
How to save images in repository and recover it through a Path with Asp.Net MVC? Searching in some places, I found that saving images directly in the database may have a significant loss of…
-
-1
votes1
answer376
views -
-1
votes1
answer107
viewsProblems with Dev-cpp
I installed Dev-Cpp 5.5.1 and it presents an error like this when I try to compile: "Failed to execute (and the file path)". Can someone help me with that? I already tried version 4.9.9.2 and the…
-
-1
votes1
answer101
viewsError logging in to server hosted on local IIS
When I test on my machine the login works perfectly, when I share over the network returns me the following error: A network-Related or instance-specific error occurred while establishing a…
-
-1
votes1
answer428
viewsMysql temporary table
How to assign an update to a temporary table in my case I do an update right at the beginning, create a temporary table and then a Rigger(trigger) in this trigger I try to assign the values changed…
-
-1
votes1
answer449
viewsProblem with builder
This is the code of my class: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Banco_Exercicio1 { public class Conta { public string Titular { get;…
-
-1
votes1
answer101
viewsDoubt in Procedure
Staff made a function in Sqlserver that makes the control of a chart for me in C#, this function brings me all the students of a referent school. The function is as follows: SET ANSI_NULLS ON GO SET…
-
-1
votes2
answers1016
viewsRegex | Take group split
This tag repeats by changing the content and I would like to know if there is a way to get each content separately TextBox TXTTESTE = new TextBox(); TextBox TXTTESTEDOIS = new TextBox(); TextBox…
-
-1
votes2
answers1950
viewsAccess is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) - How do I resolve?
The site only gives error on the server, locally ta ok! Look: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Description: An unhandled Exception occurred During the…
-
-1
votes1
answer846
views"Invalid App Id" error on "Like" Facebook button
I’m doing a blog and I’m putting the button like. The code I’m using is: This is at the top of the page: <script> (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if…
-
-1
votes2
answers251
viewsConnection to Servers on Amazon
Hello everyone someone would know tell me how to connect to Amazon servers via C# in Visual Studio I need access to Mysql and Sqlserver databases
-
-1
votes1
answer332
viewsAttribute not recognized, but Namespace is added
My attribute [DataContract] is not being recognized, but the namespace System.Runtime.Serialization is added in my using. Does anyone know why? .... using System.Runtime.Serialization; using…