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
votes1
answer24
viewsForm does not respect Location set manually
I have this code to open one form which has the size 324x172. I’m doing this way to open as per resolution: FormLembreteCheque aviso = new FormLembreteCheque(); int c =…
-
0
votes0
answers29
viewsHow do I publish a process-dependent application together?
Is there any way to publish an Aplication console with dependency on other consoles ? Today I have a screen of Windowns Form that is my login screen, I select which console application should be…
-
0
votes0
answers58
viewsHow to pass 2 values from my dropdown
I’m trying to send 2 values returned from my dropdown for my action, but I’m not finding a solution. My dropdown lists the results of a query in the database and returns 2 values per item, I want to…
-
0
votes1
answer1235
viewsInput Mask Razor
I’m in need of help to include a CPF and CNPJ mask with Jquery or Js, so that it changes automatically after I click on a select, but I’m not able to include the mask inside the Razor I made.…
-
0
votes1
answer69
viewsHow to use SQL "in" in a lambda (Entity) C#?
I have a repository that represents my table in the database var RelacaoPessoas = _repositoryPessoas.GetFiltered(i => i.IdProcesso == idprocesso && i.Banco == numeroDoBanco &&…
-
0
votes1
answer44
viewsASP.NET C# Age passed by the url
Next, I have a page that receives age parameters that may vary in quantity. Example: url/page.aspx?idade=x&idade=y&idade=z My idea is to take all the ages passed by url and select only the…
-
0
votes2
answers887
views -
0
votes1
answer47
viewsFile generation with invalid character
I developed the code below to put information of a return from a bank select in a CSV file, however as you can see in attached print, some characters are being sent wrong even if the return from…
c#asked 5 years, 1 month ago Matheus Muniz 5 -
0
votes1
answer94
viewsProblem when converting text to decimal in ASP.NET Core deserialization
Hello, I have an ASP.NET Core Api that takes as parameter a raw body object from the request. [HttpPost] public HttpResponseMessage DoIt([FromBody]DoItDto dto) My Doitdto class has a decimal…
-
0
votes1
answer82
viewsUpdate data with Entity Framework
I have a problem that when I have this code below: public static String GravarNoBDFildes(List<Fildes> dados) { try { Console.WriteLine("Começando o processamento"); var inseridos = new…
-
0
votes3
answers588
viewsReturn of request status code
I’m doing a post for a third party API but would like to get the return code from it to save in our bank, however, I can only get this return code if the code is 202, if it was 401 or 500 it returns…
-
0
votes1
answer36
viewsMysql with . Net 4.6.2 - Error "Object reference not set for an instance of an object." dbContext class
Dear friends! I have a problem trying to access dbContext with Mysql, for example accessing Context.set(). Add(obj), I get the error message "Object reference not set for an object instance." the…
-
0
votes0
answers47
viewsAsp Net application does not run
Someone could explain to me why, when running my application on Asp Net it does not run, presenting the message "Server Error in Application '/'."? Error screen: File Routeconfig.Cs: namespace…
-
0
votes0
answers63
viewsError loading data from a listview into a texbox c# Windows Forms
I am developing my project in Windows forms, where in the register tab shows a form that has a listview with some customer data, and next several texbox to register, change, view or delete this…
-
0
votes2
answers255
viewsIntercalation of two arrays (vectors) in C#
My code has two arrays of 5 elements, a array has odd numbers while the other has even numbers and is needed intersperse, I created a third vector to do this, but the result is not expected. The…
-
0
votes1
answer419
views.Net c# Webrequest Post
People I’m studying Webrequest, I’m trying to make a query on the site of the post office and so I read it should look like this: WebRequest request =…
-
0
votes1
answer392
viewsError Dispose(bool)': no suitable method found to override C#
I’ve checked on other forums and even here, but that’s it correct with the class name o namespace is the same. He caused me other mistakes besides this, but this I believe is the main one that is…
-
0
votes3
answers114
viewsSequence code of numbers returns the incorrect sum of numbers C#
I created a code that collects a sequence of integer numbers that only runs out when the zero number is typed. At the end print the sum of the numbers is wrong where there is always a number unless…
-
0
votes1
answer114
viewsC# | How to select just a few subfolders?
I need to search the information of only a few subfolders inside a main directory, I made a code this way but I’m having a hard time finding a way to inform only the subfolders I need. For example I…
-
0
votes3
answers103
viewsIndividual average does not return value and the number of student situations does not count in C#
My code it gets 3 student grades and shows your average, counts the number of approved, failed and who are still on exams and show the average of all. The problems of my code are the accounting of…
-
0
votes2
answers180
viewsReceive data in a matrix c#
Hello, I was testing code to learn how to mess with the matrix, but I’m not able to store broken numbers in the variable. he of the error of System.IndexOutOfRangeException and I can’t solve.…
-
0
votes1
answer32
viewsConceptual problem with webservice, how to make a webMethod
Good afternoon guys, I’m having a little problem here at the time of creating a webMethod. The thing is, I need to work with three levels, in the three cases I need to send to the database, follow…
-
0
votes1
answer60
viewsCorrectly print a double value using Tostring()
I’m having difficulty printing a monetary value correctly with the distribution of its decimal places, I used the ToString() using parameters such as "C", "F" and "N", what needs to be done to leave…
-
0
votes1
answer92
viewsHow to perform multiple database insertions
I am a beginner and I have a code in which I need to insert multiple products inside a shopping list, however, in the code I made, it is only possible to insert one JSON at a time. [HttpPost]…
-
0
votes1
answer39
viewsProblem sending image to database
I have a web application in which the user can change his profile image, I am able to select the image file correctly, the problem is time to send to the database (send the application data to a…
-
0
votes1
answer34
viewsWhat is the concept behind the Ifilter.Allowmultiple property?
When studying the functionality of the "Web API Pipeline . NET Faramework", I came across the property "Allowmultiple", brought by inheritance of the abstract class "Ifilter". Microsoft…
-
0
votes1
answer47
viewsStart button / pause
I have a code that makes a stopwatch. I currently have 1 button to start time and another to continue time after having stopped. If you click the start it starts again. how can I only have 1 button…
c#asked 5 years, 1 month ago devilonline 41 -
0
votes1
answer599
viewsCreate a list with selected table values with checkbox
I have this código, that he catches the id selected from table: $("#tablepesquisaclientes tr").each(function (index, el) { var $linha = $(el); var checked = $linha.find('.checked:checked').length;…
-
0
votes1
answer83
viewsMicroservice unit test using xUnit
Hello, I have a method that uses a read Repository for a holiday table, in this case... I need to create a unit test using xUnit Follow the excerpt of my method: [HttpGet]…
-
0
votes1
answer102
viewsHow to create a select in the database that runs two tables with a single primary key?
I’m new to programming and I’m developing a note system. The case is as follows: There is a form that registers the notes, where it uses 2 tables of mysql, the notes table (where the code of the…
-
0
votes2
answers53
viewsDoubt to Bring a Details of Two Tables MVC5 Entityframework 6.2
I’m studying ASP.NET MVC5 for college, and I came across a problem, I have three tables: Usuario, PessoaFisica, Endereco. My problem is this, when I’m right in the system, I can only bring the…
-
0
votes1
answer221
viewsHow to call a c# function when an SQL Server table changes
I have the following code on C# Asp.NET 4.5 to count the number of records in my table [HttpGet] [Route("consult")] public HttpResponseMessage GetAll() { try { MatrizGeneral matriz = null; //int…
-
0
votes2
answers85
viewsPerformance between creating multiple objects or just one
I always had a question regarding the code blocks below, which would behave faster taking into account the service: foreach(var t in listaT) { using(TService service = new Tservice()) { t =…
-
0
votes1
answer26
viewsExport to excel
Good morning. I created a gridview with data from a table When I run the function to generate the Excel spreadsheet, nothing happens, could anyone give a help in what might be happening? follows…
-
0
votes1
answer44
viewsCreating a comeback With a sublist
I am trying to write a query in Latin to solve the following problem: I have a Student List that I have student data like Id, Name, Enrollment, Cpf... In another entity I have the notes where the…
-
0
votes0
answers176
viewsLoad listview with data
I have a form that searches all the bills registered in the system for the client code that was registered. When you find it, list all the notes in the listview. I was able to get him to look for…
-
0
votes1
answer190
viewsPass data from one form to another form’s listview
Good afternoon, I am developing a system in c# where I need to find the note number and when clicking add, it passes the information to the main form in listview. Can anyone help me how to develop…
-
0
votes1
answer33
viewsSend hyperlink by email - link break
I’m trying to send one hiperlink by email, however it breaks at the time of space, in the same email, I send two hiperlink, one that has no space at all, it sends correctly, but this one it breaks:…
-
0
votes1
answer59
viewsHow to use the . Sqlquery expression of EF in Efcore?
I’m refactoring a code and I’m having that doubt. public class MovimentoManualListRepository : RepositoryBase<MovimentoManualList>, IMovimentoManualListRepository { ConsultarContext _context;…
-
0
votes0
answers24
viewsClient Communication Server via SNMP protocol
I am trying to create a communication between client and server via SNMP protocol, and to begin, I installed Visual Studio 2017 and downloaded, via Nuget, the Lextm.SharpSnmpLib. I searched the…
-
0
votes0
answers98
viewsIntegrating C# projects with VB
I need to create a C# project that uses a DLL that was written in VB.NET. I added the dependency, imported the library and used the method. However, at the time of execution when I will consume a…
-
0
votes1
answer223
viewsHow to get information from a tr in HTML code using Htmlagilitypack from Visual Studio
Good night, I’m doing a C# project at Visualstudio 2019 using Htmlagillypack to capture site information https://www.infomoney.com.br/cotacoes/ibovespa/ which contains the values of the stock…
-
0
votes1
answer51
viewsHow to compare two Viewmodel
I have the following doubt, imagine there are two ViewModel: public CustoViewModel cvm = new CustoViewModel(); public CustoViewModel custoViewModel= new CustoViewModel(); And that each ViewModel…
-
0
votes1
answer911
viewsTLS 1.2 Requests with Restsharp
I need to use TLS 1.2 in an HTTP request with Restsharp. Every time I make a POST, it reports the error "The underlying connection was closed: Could not establish trust for secure SSL/TLS channel.".…
-
0
votes0
answers207
viewsGenerate txt file with custom letter font
I’m creating a code that generates a txt to print to a printer matrix. However, I would like to change the font of the letters. Someone could help me, please? Follow the code below. try{ byte[]…
-
0
votes1
answer83
viewsMultiple Repository constructors using Unity Application Block C#dependency injection
I have a project that uses Unity Application Block dependency injection. Has the repository class: public class RepositorioDeLaudoMedico: RepositorioGenericoEntityFramework<LaudoMedico, int>,…
-
0
votes1
answer50
viewsDifficulty with Clickonce c# Wpf
I have an application and recently I had to implement the Webdriver Phantonjs, which simulates a browser but in a way that is invisible to the user. In my application everything is ok, it works…
-
0
votes0
answers131
viewsRoutine execution in the background via Hangfire (ASP.NET Webforms)
I am in need of doing a background run on my system. For this I found the Hangfire tool. I made the settings according to the documentation and am getting the error: Value cannot be null. Parameter…
-
0
votes2
answers74
viewsCreate methods in classes to manipulate fields
I made a code of a binary association between two classes Cliente and Caixa, some methods I might not understand how they are inserted into the code in logical way, but the code itself is working, I…
-
0
votes1
answer63
viewsWhy isn’t this program running the commands inside the second function on?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EX7 { class Program { static…