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
answer105
viewsDatabase based query listing
First of all, I apologise if the question is vague, as it is a very broad subject. Today I have a student registration and consultation system, where the query is made exclusively by CPF, since it…
-
0
votes1
answer42
viewsProblem passing information from AJAX to Controller
I have the following ajax that picks up the order code. So far I can pick up the order code, but sends as null to controller var btn = document.getElementById("btnNumeroPed"); btn.onclick = function…
-
0
votes1
answer284
viewsHow to get the listbox to be ordered increasingly?
Hello! My C# project has a listbox that lists numbers typed by the user. What I want to do is that these numbers are constantly being updated increasingly in the listbox. I tried to use the Sorted…
-
0
votes0
answers276
viewsError entering data in datagridview
I have the following code: public partial class PesquisaAluno : Form { List<ModelAluno> alunos; public PesquisaAluno(List<ModelAluno> alunos) { InitializeComponent(); this.alunos =…
c#asked 6 years, 8 months ago Lucas Bustos 97 -
0
votes1
answer123
viewsScripts stop when I open Modal in a Partial View for the second time
My first question here. I am developing my first system using Asp.Net MVC. In a View I call a Modal whose modal-content is a Partialview containing scripts (jQuery). When I open Modal for the first…
-
0
votes0
answers214
viewsHow to insert a signature in outlook via c#
Hello, I am trying to add a signature to an object that sends email, I am able to do everything but the subscription... Follow the Code, any light will be welcome. OutLook._Application outlookObj =…
-
0
votes1
answer606
viewsViewbag and Viewdata Doubt
I’m starting my career in development, and in the company project here, I found a ViewData being used, and for my researches I can not update it in a ActionResult in the controller. I ended up…
-
0
votes0
answers75
viewsDoes not update value
Calculus and values return me all right, but when overriding the previous value and add the new one it does not change, keep the old one. Compra Controller: public ActionResult Update(CompraModel…
-
0
votes0
answers85
views -
0
votes1
answer247
viewsdecimal field minus comma c#
Good afternoon, I made an assignment as follows: dadosRedistribuicao.QUANTIDADE = (Decimal.Parse(txtDisponivel.Text) * Decimal.Parse(percentual)) + Decimal.Parse(distribuicao); data.QUANTITY is…
c#asked 6 years, 8 months ago Stand Alone 350 -
0
votes1
answer271
viewsSystem.Collections.Generic.Ienumerable
Help, guys! I’ve tried to do everything, already includes "using System.Linq"and nothing. Anyone knows? Medicoscontroller using System; using System.Collections.Generic; using System.Linq; using…
-
0
votes1
answer86
viewsC# controller function receive an array
I need to take a select array and send it to a function in the controller, but it always arrives as null, even sending the full array. Below is the code: Controller: [AcceptVerbs(HttpVerbs.Get)]…
-
0
votes1
answer143
viewsHow to call a Function in c#
var inputElements = webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement i in inputElements){ if(i.GetAttribute("name").Equals("user")){ i.InnerText = "Teste"; }…
c#asked 6 years, 8 months ago user108649 -
0
votes1
answer1077
views -
0
votes1
answer646
viewsModal boostrap inside Updatepanel after event click dark background
I have a modal boostrap Poup within a component ASPX UpdatePanel inside that modal I have a button ASP btnEditar with event click to perform a update. After executing the event the modal closes but…
-
0
votes1
answer105
viewsRetrieve Listview values - Getelementbyid
Good night! I have a listview and I am displaying the values inside Span’s, I would like to take the value of span when clicking but as Span’s have the same ID I always get the same value. Does…
-
0
votes1
answer1841
viewsDeserialize List JSON C#
In my program I do a GET and get the following: {"totalcount":2,"count":2,"sort":1,"order":"ASC","data":[{"2":8283,"1":"Teste","12":6,"15":"2018-03-29 11:30:04","19":"2018-03-29…
-
0
votes1
answer376
viewsC# how to send an email containing a hyperlink using System.Net.Mail?
I created a class for sending emails using the System.Net.Mail library. To send the message format in HTML. The message I am sending is as follows:: <div style="display: block; margin-left: auto;…
-
0
votes1
answer196
viewsHow to Overload a constructor and also call the base class constructor in C#?
I am creating a C# error that should extend the class Exception but, should also add an extra property, thus: public class CampoVazioErro: Exception { public string campo { get; } public…
-
0
votes1
answer636
viewsProblem with accentuation when exporting data from Sql Server to Excel
I have the following code inside a button responsible for performing the export of data from my table to excel. string caminho = "c:\\caminho"; // criar um arquivo para escrever using (StreamWriter…
-
0
votes1
answer61
viewsLinq to Objects - Performance
When searching for best practice content when using LINQ I came across the following filter situation: // Filtros int idBairro = 8626; first way: IQueryable<TesteConsulta> queryCidade = (from…
-
0
votes2
answers107
viewsBring another field in group by
I have it var grupo = from item in aliquotaProduto group item by item.CFOP_ID into agrupamento select new { Categoria = agrupamento.Key, Quantidade = agrupamento.Count() }; I can bring an ID_PROD in…
-
0
votes2
answers159
viewsHow to use the Where clause with Inno?
I need to make a Join between the person and people tables so that the core Entity Framework brings a corresponding record. Let me be clearer: In the personal tableentity, I sort my register of…
-
0
votes1
answer51
viewsContinuing task execution even after exception
The method RelatoriosEstaticos.AbrirDataAtual which is within the Task below is returning an exception already dealt with in the method itself, the problem is that the Task continues the execution…
-
0
votes2
answers132
viewsHow to change EF6 to create Datetime fields as datetime2
I am working with **EF6 Code-first", SQL-Server database. I came across the following error, when saving an object with Datetime property. The Conversion of a datetime2 data type to a datetime data…
-
0
votes1
answer147
viewsImprove Process Performance C#
Good morning, I have a problem of slowness when performing a process that is performed 1 Insert and 2 Updates for each record. That is 2500 records, will be held 7500 access in the database. Here is…
-
0
votes1
answer111
viewssaveFileDialog, select the last modified folder
I would like to know how to make saveFileDialog, open my last modified folder, thus taking the operator’s job of selecting it. I tried to use this one I found in the gringo stack, but it didn’t…
c#asked 6 years, 7 months ago Felipe Deolindo 179 -
0
votes3
answers636
viewsObject Reference not set to an instance of an Object. - Json
Follows code: public class Name { public string type { get; set; } } public class Items { public string type { get; set; } } public class Hobbies { public string type { get; set; } public Items…
-
0
votes1
answer56
viewsPass Httppostfilebase as parameter in the API method
I have an Api that makes employee registration and also a photo, in the parameter I pass the object and a type htttppostfilebase, but when sending to api in my debug is not even hitting the method,…
-
0
votes2
answers99
viewsSystem.Nullreferenceexception: 'Undefined object reference for an instance of an object. '
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using…
c#asked 6 years, 7 months ago Jonatan Bortolon 1 -
0
votes0
answers93
viewsShow Image in Datatable Asp.net MVC
I’m having trouble displaying an image in my application’s datatable. I get the name of the image but it does not display. "columns": [ { "data": "Id", "name": "Id", "autoWidth": true }, { "data":…
-
0
votes1
answer59
viewsWPF - Access Usercontrol of a selected Tabitem
I own a Tabcontrol with several Tabitems, that I have separated the contents into Usercontrols to organize the code. But they all have a Textbox in common of which I want to get the value on a…
-
0
votes2
answers119
viewsCall Method C#
Hello, I’m with a project in progress where I have an employee registration screen. I need to leave the edge of the TextBox red if there is something wrong with filling it out. I tried in many ways…
c#asked 6 years, 7 months ago Giovani Rodrigo 299 -
0
votes2
answers82
viewsWorking with vectors / matrices
Hello, I have the following question, I have 5 vectors string[] Defesa = { "Gigante", "Golem", "Gigante Real" }; string[] AtkTorre = { "Corredor", "Ariete de Batalha", "Gigante Real" }; string[] AP…
-
0
votes2
answers235
viewsHow to change the appearance of the form according to the operating system?
When developing a project in C# (Windows Form Application) the appearance of the application window (borders) is in accordance with the OS in which I am running the application (Windows XP, Vista,…
-
0
votes0
answers147
viewsProblems returning a Iqueryable<> list to convert it with Automapper
I have a function that returns me a list of people with their personal/legal relationships. I own a Personal Viewmodel that is already mapped in the Autommapper layer... When I call the Getjoinall()…
-
0
votes1
answer161
views -
0
votes1
answer110
viewsRequest sent more than once when selecting a form field
When I select a specific field from a form, I trigger a request to load some essential information to complete the form, only when selecting a form field it fires 3, 4 requests and this causes my…
-
0
votes1
answer416
viewsError while consuming webservice in c#
I am making a web service in c# , to consume its data via javascript (without being an application made in Asp.net or any technology . NET ,I want to use html and javascript only). My web service…
-
0
votes1
answer37
viewsSelect with filter in Entity being generated duplicate
I have a droplist that lists the states, that when a state is selected it filters the cities related to that state. It turns out that when I select cities comes duplicate. For example, I have states…
-
0
votes1
answer217
viewsLoad Bitmap into Picturebox
I’m building a code to scan biometrics. How do I put the generated image into the device in pictureBox What I use to mount the image in bitmap public Bitmap ExportarBitMap() // Exporta para o BitMap…
-
0
votes1
answer46
viewsSet login page by user profile
Good afternoon guys, I need a little help from you. I have two access profiles to my system. "Master-IT" and "Developer" This is my system login controller [HttpPost] public ActionResult…
-
0
votes1
answer42
viewsMap sub-property
I have three classes public class Ligacao { public string Guid { get; set; } public string Telefone { get; set; } public Status Status { get; set; } public string ArquivoJson { get; set; } public…
-
0
votes1
answer1028
viewsPopular Canvas Chart with Database List
I need to make a Dashboard and I’m having a hard time to popular a line chart of a canvas chart. I need date and label arrays to be filled with data from my list but don’t know how to do it What I…
-
0
votes0
answers379
viewsClass diagram from already created classes does not show the relationship
When I create a class diagram in VS2017 from existing classes, the relationship link does not appear. namespace CloudEye.Domain { public class Car { public CarPlate CarPlate { get; private set; }…
-
0
votes0
answers385
viewsHow to make Table with two foreach close <tr> </tr> Asp.Net MVC
I need to make a table that for each row I have the information as shown below See that in Lot 1 until City the data does not repeat at each foreach and only from the column Species the data…
-
0
votes0
answers264
viewsJump(Jump) method with more than one animation sequence
Friends I’m messing with the jumping animation of a character and this animation has two sequences, one of when walking, the other running: if (Input.GetKeyDown(KeyCode.Space) && liberaPulo…
-
0
votes1
answer125
viewsAsp.Net MVC Binding view model with a List
I’m trying to make a Binding of my view, only when the action is called my object filaViewModel comes with the filaViewModel.Validators equal to null. I’ve tried to pass with @Html.Hidden("Code",…
-
0
votes1
answer231
viewsQuestions about using the GUID type instead of int
I see many models of systems on the net where Id fields are set with GUID type instead of INT, as in the example below: public class Product { public Guid Id { get; protected set; } public string…
-
0
votes1
answer65
viewsBest way to ensure consultation isolation
I have the following scenario: A table in SQL Server that contains process records that can be run on multiple services (Windows Services in C#) from multiple servers. Something like: CREATE TABLE…