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
answers60
viewsEnd Process C# Mono
Good morning, I have a method that closes the application when I change the settings in windows, but in linux system it does not end the process follows below the code. if (strProcesso.Trim() == "")…
-
0
votes1
answer32
viewsASP.NET read data from a POST ajax
Below is my "form" I want to send to the server in an ajax post $('#ajaxButton').on('click', function () { const ajaxFormData = { nome: $('#nome').val(), zap: $('#whatsapp').val(), email:…
-
0
votes1
answer941
viewsError running ASP.NET Core application
I am starting the journey to learn ASP.NET Core and when I try to run the application I have the following error: An unhandled Exception occurred while Processing the request. Socketexception: No…
-
0
votes1
answer332
viewsError Performing Update on Entity Framework Core
I own a Teste de Integração that carries out the updating of an object in the database, for this I instate a new entity and insert the different properties and insert a Valid PK id however while…
-
0
votes1
answer26
viewsComparison of dates using Timespan.Compare()
I’m trying to see if a schedule exists within a range of initial and final hours, but I’m having a problem setting the condition. Example Parameter time: 07:00:00 Initial time: 06:00:00 Final time:…
c#asked 5 years, 4 months ago Igor Carreiro 1,917 -
0
votes0
answers312
viewsConverting a datetime2 data type into a datetime data type resulted in a value outside the range. The instruction has been completed
I have a class, a client who has a record date. public class ClienteViewModel: Pessoa { [ScaffoldColumn(false)] public DateTime? DataCancelamento { get; set; } [ScaffoldColumn(false)] public…
-
0
votes0
answers82
viewsReal-time graph problem C#
I’m trying to draw a graph in real time. On this graph I draw the dot sign (0,y) to the point (Width,y) using a red cursor to know where you are currently drawing. When the graph reaches property…
-
0
votes3
answers1009
viewsHow to make a Useful days rule in Asp.net and C#?
good afternoon I am wanting to create a billing email sending rule that when there is a holiday he considers the next day and if it is Sunday he performs the task on Tuesday. Today the system uses a…
-
0
votes0
answers25
viewsHow do I index a system’s pages to Google? (SEO)
I have a doubt, that I could find no answer anywhere, the ones I found left me somewhat confused. How to index the urls of my system in ASP.NET on google, for example a static site already has the…
-
0
votes1
answer535
viewsHow to search data in any column of datagridview, after popular it by the c#database
I have a datagridview that takes the data from the sqlserver database and needed to make queries, but as they are a lot of data we can’t keep pulling from the database. wanted to do searches through…
-
0
votes2
answers115
viewsAssign database value to a variable c#
I want the value I got from the openCath to be assigned to the check variable. And then to scroll a check. abertoCath is an int of my tblCath, id Box is my Primary key of the table tblCath. private…
-
0
votes2
answers70
viewsIs it better to use overloading or add an "if" with the optional parameter?
I have a method in which an attribute may not be used In this case if the value passed is not empty it adds the parameter to my email public async Task<bool> SendEmail(string to, string…
-
0
votes1
answer77
viewsC# - How to create an implementation contract with subclasses to be implemented?
I would like to create an interface (called Interfacex) interface InterfaceX { ... } Where your future implementation returns the following structure:…
-
0
votes2
answers99
viewsSending a Data List by Email - ASP.NET MVC C#
Good evening, I’m making a web application for college where I need to send a list of data (food) coming from a quote. That is, the user selects the items that will quote and after this sends via…
-
0
votes1
answer53
viewsProblems with Combobox
I am developing a software that catalogues manga. In it you have the option to select 2 genres for the manga. Generos are loaded into a Combobox from a Mysql table and when the user registers the…
-
0
votes0
answers74
viewsValue Summation Problems with C# and Mysql
I’m developing a software that catalogs manga, one of the problems I’m having is with input volumes. What should happen: the user set the numVolumes to 2, that is, he will add 2 more volumes of…
-
0
votes4
answers712
viewsHow to access only the first position of each row in an array of arrays (matrix / multidimensional array) using foreach?
I have a array multidimensional / array of arrays / matrix (as you prefer to call): public string[,] operacoes = { { "SOMA", "", "" }, { "SUBTRAÇÃO", "", "" }, { "MULTIPLICAÇÃO", "", "" }, {…
-
0
votes1
answer575
viewsFile upload problems in Multipart/form-data. C#
Hello, my problem is this, I have a simple web application running on apache on localhost. Which has the following code: <?php if (isset($_FILES['arquivo'])) {…
c#asked 5 years, 4 months ago Joao Vitor 1 -
0
votes0
answers30
viewsResizing an image
I’m trying to resize an image with this code. public static Bitmap ResizeImage(Image image, int width) { var destRect = new Rectangle(0, 0, width, image.Height); var destImage = new Bitmap(width,…
-
0
votes1
answer37
viewsIcollection property in class is not instantiated
I have the product class and in that class I have this property public virtual ICollection<CspProduct> CspItems { get; set; } Here we take the products var products =…
-
0
votes0
answers452
viewsI cannot install package I created . NET - NUGET
I recently created a package in Nuget in order to perform some tests with a private Nuget server. I did it this way in Visual Studio 2017: I created a new Class Library project (.NET Standard) I…
-
0
votes0
answers83
viewsGetting null using external api with restsharp
I am facing a problem when trying to get an external API that returns Json. Instead of storing the value of json variables in the model is receiving null. Model: namespace bitcoin.Models { public…
-
0
votes0
answers25
viewsCreate a web form model
I’m putting together a web page with . Net Core and I have a web form that has many fields and I was thinking about how to get all this information filled out more dynamically, I asked a question…
-
0
votes1
answer128
viewsTcpclient C# Windows Form how to close and open the same connection
I am developing a Windows Form C# application and I am using Tcpclient to carry out communication within my internal network, in some moments I need to close an existing connection and after a few…
-
0
votes1
answer33
viewsHow to improve code
I have the following method: public async Task<ActionResult> AlterarRequerimentoAsync(RequerimentoViewModel model) { if (ModelState.IsValid) { var projeto = await…
-
0
votes1
answer27
viewsJenkins setup with Nunit error
Good afternoon! I’m trying to set up Enkins to check my tests, but it’s a mistake. I imagine you’re doing something stupid that I don’t understand, could help me? My Windows Command Settings: ""C:…
-
0
votes3
answers93
viewsHow to find certain words inside a string in C#
For example: string query = "INSERT INTO Recibos (idRecibo, DataRecibo, NomeCliente, Valor, CPFCliente, EnderecoCliente, NumeroCliente, BairroCliente, Importancia, Referente, Cidade, UF, Emitente,…
c#asked 5 years, 4 months ago Oto Emerson 25 -
0
votes0
answers248
viewsUnity - No public constructor is available for type Mvcteste.Repository.Iempresaservice
I’m using UNITY to inject dependency. net framework 4.5, configured everything else at the time of running is presents the error : No public constructor is available for type…
-
0
votes0
answers27
viewsProblems with Savedialog and Windows Forms output function
Guys, here’s the deal: I’m making a notepad in C# for educational purposes and I come across a mistake I haven’t been able to see for two days. Whenever I will save a txt file it opens the window…
-
0
votes2
answers118
viewsError inserting formula into a cell in Excel via C#? Worksheet?
I have the following code: newWorksheet.Cells[1, 1] = "Status"; var var1 = newWorksheet.Cells[2, 1] as Excel.Range; var1.Formula = "=CONT.SE(Planilha1!B2:B7;'Ativo')"; newWorksheet.Cells[3, 1] =…
-
0
votes1
answer194
viewsEdit C#XML file
I’m having a little difficulty editing an xml. I get the following xml: <cteProc xmlns="http://www.portalfiscal.inf.br/cte" versao="3.00"> <CTe…
-
0
votes1
answer87
viewsTaking values from a form using a model
I’m creating a web form and I’ve been told here at Sopt to use a model, since I’m using . Net Core Razor. I am trying to create the model, to pass parameter but I cannot recover the values of the…
-
0
votes1
answer325
viewsMobile Validator in a Rest Api query
Today I use SMS sending system for our customers who are registered on Tiny ERP, but I am in need of a mobile validator to be able to send scheduled SMS that are saved in a local bank. The problem…
-
0
votes0
answers148
viewsI cannot check 'Mark Clickonce manifests'
I have a Visual Studio project where I need to sign Assembly this way: For the Phoenix_panel project (example print above) marking this item is optional. But for the Phoenix_communication project I…
-
0
votes0
answers61
viewsCheck if the name is already registered in the Database
This is a Mangáka registration screen, so if I type a name it is added without problems, however I want to check if there is already any record with that name. Table: create table tblMangaka(…
-
0
votes1
answer105
viewsCreating an object with a random internal datum (Random)
I am trying to create an object called "State", however I would like the DDD of each object, when creating, to be generated randomly. class Estado { public int Resultado { get; set; } public string…
-
0
votes1
answer5333
viewsWhy does VS Code auto-complete not work for Unityengine library elements even with the built-in extension?
The problem is just this, I’m developing a new game by Unity and use Visual Studio Code as editor, and need to auto-complete to help, but even with the extensions "Debugger for Unity", "Unity Tools"…
-
0
votes1
answer57
viewsError filling cascading combobox: Failed to load Resource: net::ERR_CONNECTION_RESET
I am trying to create a method to register a coefficient, this coefficient is linked to a table, which in turn belongs to a Concourse, the idea is to select the Concourse in the first combobox and…
-
0
votes0
answers19
viewsModal inside a Peater
I have a link inside a Repeater that calls a modal to display more details of the list that is being displayed by this Repeater. The problem is that I am not being able to show the modal for each…
-
0
votes0
answers2051
viewsCustom userControl events still running in the code in the visual studio, is that a bug?
I am developing in WPF, and while doing a custom userControl, I had a surprise, when I went to use the Events "Routedeventhandler Loaded" and "Routedeventhandler Unloaded" of…
-
0
votes1
answer116
viewsHow to find the user logged in to the Infra layer? (Using DDD with C# MVC EF)
I’m developing a feature for storing the history of screen record modifications. Example: I have a register of people, in this register of people, at each action performed (Insert, Edit, Delete) I…
-
0
votes0
answers163
viewsHow to pass a Datatable to Reportviewer?
I receive the database query in a Datatable, I need to pass the datatable to a tablix in reportviewer by code, but when I run the tablix returns blank, I searched in several places and did not find…
-
0
votes1
answer59
viewsInsert Formula Matrix in Excel, via C#. ? (If you insert directly through excel, I have to give Crtl - Shift - Enter) - How to do this command with C#?
The following Code inserts a Formula into a cell in Excel. Based on the Spreadsheet "DATA", AND According to the column beside. However, this formula is a Matrix Formula, which in Excel needs to be…
-
0
votes1
answer180
viewsImplement Save As and Save in C#
You know that basic difference between salvage and the save as of the text editors? So, I’m wanting to put in my application only the option "save", however, after searching a lot on the net only…
-
0
votes2
answers54
viewsHow to assign the name of a component, where it does not exist in the current context
I have a form for client registration and within this form there is a RadioButton that asks if this customer needs to send invoices, if the answer equal to SIM arise two components, a TextBox and a…
-
0
votes2
answers259
viewsC# - Can you run a task and return to the main thread later?
in the case the whole program is written without task and only one excerpt is with task, I wanted after that piece it returned to the "main thread". The code below is inside a for, and serves to…
-
0
votes0
answers81
viewsHttpwebrequest Proxy-Connection Set
I’m trying to accomplish the WCF sending via SOAP. Can send via SOAPUI, as picture there is the parameter "Proxy-Connection": In C# there is no such parameter "Proxy-Connection": HttpWebRequest req…
c#asked 5 years, 3 months ago Tiago Casanova 778 -
0
votes1
answer161
viewsPass array parameter by HTTPGET in ajax to Actionresult
Hello. I have an Ajax Httpget function that would need to take an array to an Actionresult. How do I do this? $.ajax({ url: 'AtualizarTabelaDeRelatorio', data: { arrayDeInstalacao:…
-
0
votes1
answer52
viewsHttpwebresponde format return
I have the following Code: try { public string ProcessAttachment(string fileInput) { HttpWebRequest req =…
c#asked 5 years, 3 months ago Tiago Casanova 778 -
0
votes0
answers31
viewsNot pulling XML information
At the moment where I import XML information, it does not separate and play to the XML_List, for continuity to the code, it returns no value in that part of the code: XDocument xDoc =…