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
votes1
answer210
viewsDownload the VARBINARY image
I have images saved in an SQL database on varbinary, I would like to know how to bring it back in my application and download it to the machine in some format (.png, .jpg). I’m programming with…
-
1
votes0
answers127
viewsHow to pass the date to day, month and year in C#?
I need to pass my dates for day, month and year in Brazilian format, but I searched the code and the internet and I do not know apply the examples to my problem. It returns the results so I need to…
c#asked 5 years, 9 months ago Lucas Tadeu Egídio Arruda 281 -
1
votes3
answers591
viewsAccess to the path 'path' is denied. VS2017
I am trying to create a file and save it in a folder created by me with the name "temporario". I created this folder on disk E: and inside my program, on disk C:. Using File.Create(file), error…
-
1
votes1
answer179
viewsTransform Sql command into LAMBDA
I’m learning a little about LAMBDA and tried to convert this query into LAMBDA, but I stopped. I have 2 classes: public class Voo { public string idVoo {get;set;} public DateTime dtVoo {get;set;}…
-
1
votes1
answer136
viewsCan static classes and methods be used in ASP.NET MVC without problems between user sessions?
I did a routine of login using cookies and as I’m always looking for this information, so you don’t have to be instantiating everywhere I use I left these static classes, my question is if there…
-
1
votes0
answers213
viewsAdd new values to an already filled Linq variable
I made that Lambda/Linq: var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table, p => p.CategoryId, c => c.Id, (p, c) => new { Product = p, Categories = c.DefaultIfEmpty()…
-
1
votes1
answer55
viewsadd blank line to a list
I have a list already with data and I want every 3 lines to add a blank line in this list. To then move to a grid. How can I do that? For now the code is like this: anoanterior =…
-
1
votes1
answer38
viewsWhen loading page, open first tab with results
I have five tabs, and each one displays or not the result of a query in the bank. <div class="container"> <ul class="nav nav-tabs"> <li class="active"> <a data-toggle="tab"…
-
1
votes0
answers51
viewsHow to block part of a method to be processed only once per request with . net core
i have to increment a column in the database and this increment may depend on the situation, for example increment according to the user, I am using Jmeter to send 100 requests at the same time, but…
-
1
votes1
answer45
viewsHelp in riding a lambda from a foreach
I have this foreach: foreach (var row in responseObject) { if (row.CDOrigem == request.CentroDeDistribuicaoId) { if (row.FaixasPreco == null || row.FaixasPreco.Count() == 0) { var uniqueItem = new…
-
1
votes1
answer141
viewsReturn json from query Inner Join ASP.NET WEB app C#
Good afternoon, you guys. I’m trying to return the result of a query with INNER JOIN in a C# REST API but I’m not getting it,I can’t use frameworks, it has to be at the base of the code, I’ve…
-
1
votes2
answers290
viewsDoubt in passing parameters via AJAX to ASP NET CORE Action
Friends, I’m having trouble passing a value to the action of a specific controller that takes as parameter an id of type int. AJAX var dataForm = $("#statisticId").val(); $.ajax({ contentType:…
-
1
votes1
answer309
viewsCombine TIFF files on a multi-page TIFF C#
I’m making a program to convert and concatenate files. I wanted, after converting the PDF files into TIFF, to combine them into a single multi-page TIFF file. I’ve been looking for a long time and I…
-
1
votes1
answer1981
viewsAutomappermappingexception: 'Error Mapping types. '
Could you help me with this mistake described in the title, please. I am using the Automapper in the same way in other classes and only in those classes is it making this mistake. I couldn’t…
-
1
votes2
answers48
viewsHow to create a new object containing all the values of an initial object but adding new attributes in C#
Hello, I have a question regarding C# and the optimization of the form of code generation. In Typescript, if I have the code below I can create a new object from a previous one and, in the creation…
-
1
votes0
answers31
viewsHow to upload a file to Cloudflare?
I want to upload a file to cloudflare, but before that, it uses protocol tus. Follow the code below: var cloudflare = new HttpClient(); var zoneId = "xxxxxxxxxxxxxxx"; var email =…
-
1
votes0
answers317
viewsHow to send the value of a combo box to the database
Man ComboBox brings the ID Primário table Produto to be registered in a new table that is the Pacotes. So far so good, the problem is that if I select another record on ComboBox it saves as if it…
-
1
votes0
answers468
viewsMaximum request size exceeded Httpexception (0x80004005)
I am trying to upload files on my system however I cannot due to error message: Httpexception (0x80004005): Maximum request size exceeded. I’ve tried several solutions and nothing Following the code…
-
1
votes0
answers57
viewsOpen Form Via Contexmenustrip, random value click event
I have the following problem: I have 2 form FrmCadastroPessoa and FrmCadEscala. In FrmCadastroPessoa have the DataGridView shown, when I right click on a Cell, lists the scales the person is…
-
1
votes1
answer30
viewsChange foreground color in XAML Binding (not working)
I have a text that color should alternate according to the method check below: public Color VerificaAlarmes { get => ChecarLimites? AlarmColors: Color.Gold; } public Color AlarmColors { get { if…
-
1
votes2
answers54
viewsEvent call at another event
I have in my code the event dgvCellValueChanged that will be triggered when some value of the label is changed, it calculates the value of column 0 * column 1( Value 1 * Value 2) and assigns the…
-
1
votes0
answers42
viewsHow to access the stream before compression runs via Global.asax?
On the server side apply compression when possible: public MvcApplication() { this.BeginRequest += OnRequestBegin; this.PreSendRequestContent += OnPreSendRequestContent; } private void…
-
1
votes1
answer58
viewsHow to Show a split result on the screen
I am developing a project in which the result of the division of the 5 items always 0, someone can help me to tidy up private void btnCalcu_Click(object sender, EventArgs e) { //convertendo Total =…
-
1
votes1
answer260
viewsHow to call a class method in webforms code-Behind?
It is possible to call a class method in the webforms code-Behind? Default.aspx: <div class="row" style="margin: 50px"> <div class="col-md-6"> <asp:TextBox ID="txtElemento"…
-
1
votes1
answer245
views.net core json files
I am making a simple web application, it will read a json file: { "hotelName" : "Jumeirah Creekside Hotel", "thumb": "https://loremflickr.com/130/100/dubai", "stars" : 5, "location" : "Garghoud",…
-
1
votes1
answer39
viewsTransmission error socket c#
I have the following code: public void StartListening() { try { btEngine = new Engine(true); IPAddress ip = IPAddress.Parse(txtServer.Text); IPEndPoint localEndPoint = new IPEndPoint(ip, 5000);…
-
1
votes0
answers25
viewsCreateinstance in Typed class
My intention is to recover mine Entity and the Repository by means of a string passed to the method. With that I’ll make sure he can execute the GetAll() of my generic repository independent of the…
c#asked 5 years, 8 months ago Victor Laio 2,043 -
1
votes0
answers43
viewsI cannot add . txt files in . tar(C#) . net framework 4.6.1
Good morning! I want to add the . txt files (as shown below) in . TAR [![insert image description here][1][1] but I’m not getting it. the file . TAR is created, but the files are not added. Follow…
-
1
votes0
answers179
viewsC# As Testart Commandshandlers using Mediator and CQRS standard
I have never worked with tests before and would like to learn. I’m using the MVC + DDD + Domain Notifications + CQRS + Event Sourcing + Unity of Work and Repository standards. There is my controller…
-
1
votes1
answer56
viewsIncludes in Entity Framework Core
Good afternoon, I have a problem to use Entity Framework Core, when I will do a query with includes as below: var protocolos = _protocoloService.Search(p => p.Active == true, p => p.Include(l…
-
1
votes2
answers213
viewsModify attributes of a label with a dynamic name
Example I did this because I am creating Controls and names dynamically, well. the problem is when I need to use or call these values. If I want to change the value of the control your text or value…
-
1
votes0
answers78
viewsEncoding exception.Registerprovider with Restsharp
Hello! I am getting an exception in "mscorlib.dll" when using Restsharp to every request made to the API. Exception thrown: 'System.Argumentexception' in mscorlib.dll ("'' is not a valid encoding…
-
1
votes0
answers150
viewsHow to return a file through my API configured in ASP.NET MVC 5
I developed an API that searches images and now I need to deliver the files to download, so I created the following code: public HttpResponseMessage Download(string id) { Download download = new…
-
1
votes1
answer53
viewsHow to send the Data Time Picker date to the Mysql database
Speak guys I have a problem that is send my DTPentrar alias DataTimePicker, follows photo of the error and the code, if anyone can give a light thank you. Hugs private void btnSalvar_Click(object…
-
1
votes1
answer55
viewsWhen executing function javascript screen items some
Hello, when I run a javascript function, my screen items disappear, does anyone know why this might be happening? My normal screen: My code of function: The items disappear in the validation…
-
1
votes2
answers609
viewsBanknotes and coins C#
I’m having an error in an algorithm I’m implementing in the c# language on the JUDGE website online, Banknotes and coins And I don’t really know what it is, but I believe it’s about the…
c#asked 5 years, 8 months ago pablo kevin 13 -
1
votes2
answers518
viewsHow to group a list of objects and after the grouping, get the list of objects that have the lowest value in c#?
I have the following structure : namespace teste { public class Produto { public string Nome { get; set; } public decimal Valor { get; set; } } public class Program { public static void…
-
1
votes3
answers339
viewsThe name "Arthur" does not exist in the current context C#
I am doing a test where I seek to get the Client information by Classemenu. However, I’m having a hard time getting the information to the Program. Client class public class Cliente { public string…
c#asked 5 years, 8 months ago arthursn93 25 -
1
votes1
answer248
viewsDebugger does not work
I have the following function in C# and in JAVASCRIPT when I place a stop point (F9) on the function in c# it works normally, but the debugger No, he won’t stop, I’m doing something wrong? I’m using…
-
1
votes1
answer86
viewsXamarin-Forms - Listview expansive
I have a database to create a menu, in this I have three tables: 1 - Types of menu 2 - Groups of the menu 3 - Menu options This database will be updated and consulted by a WEB API that has already…
-
1
votes2
answers43
viewsError with Abstract method
Good morning, does anyone know why the compiler keeps accusing the error saying that the method is not declared as Abstract, but even though I have declared? Follow the Repl.it link:…
c#asked 5 years, 8 months ago Wellington Mazoni 79 -
1
votes0
answers100
viewsUpdate Datagridview in c# via Trigger UPDATE SQL
Hello, I have the following question. I’m running a c# application with SQL Server database. I have a Datagridview where he is carried via Datatable, the information loaded is from people: Name,…
-
1
votes2
answers97
viewsPulling repeated data from the database to Datagridview
I’m working on a c# project where I have a form TelaInicio where there is a DataGridView where all bank information is loaded and for this I have created a method called CarregarGrid() in form…
-
1
votes1
answer139
viewsRecover Select from Any Trigger
How can I get one back select of a trigger? Example: CREATE TABLE PESSOA2 ( ID INTEGER IDENTITY NOT NULL, NOME VARCHAR(250) ) CREATE TRIGGER SELECIONAR_NOME2 ON DBO.PESSOA2 AFTER UPDATE AS BEGIN…
-
1
votes1
answer164
viewsHow to make a Join in C#
Guys I’m having a question, I can make a SQL command (Ex.: select * from T_TABELA) in my C# repository like I do in the database, but I’d like to know if you can do a command join in the same C# I…
-
1
votes1
answer114
viewsFilter words contained in Bindingsource
I need to filter in my DataGridView which has as the datasource one BindingSource (filtro_descricao). I need to search the lines for the text typed in textbox1 regardless of the order they are in…
-
1
votes0
answers142
viewserror with windows forms
Created an application, on my pc runs normally, but on the client’s pc presents the following problems: here the full description: Assinatura do problema: Nome do Evento de Problema: CLR20r3…
-
1
votes1
answer243
viewsProblems passing 3 parameters via AJAX request -Asp.net Core MVC
I need to pass 3 parameters to my controller, but the values are not enough: Personal Contact Personal Modelcontact Contact Information: Complex parameter (class with properties); int…
-
1
votes0
answers60
viewsHow do I save this image in the gallery and access it again?
I have this Xamarin Android App (not Forms) that just opens the camera and allows me to take a photo and go with it or resume. After I say I want to keep it, it appears in the app in an Imageview…
-
1
votes1
answer429
viewsDecoding on Base 64 does not consider "Ç"
I have the following code snippets: window.btoa(CodAcabamento) //Codifica meu código para enviar para a WebApi string CodAcabamentoDes = Base64Decode(CodAcabamento); //Decodifica meu código para…