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
answer169
viewsPartialview not clicking on the default of Select2
I’m having a problem when I call my Partialview, it loads all the data in the View but not in the right format (layout) of Select2, in case when clicking the input appears the data, is currently…
-
1
votes0
answers37
viewsSystem.Outmemory error while exporting excel c#
I need to export a report to excel in c#, but when I use this code, the exception is returned 'System.OutOfMemory' on the line: wb.Worksheets.Add(dt, "Relatorio"); on account of excel size (580mil…
-
1
votes1
answer436
viewsValidate fields with Onclientclick
I’m trying to call a function Javascript through the OnClientClick. The problem is that when running in the browser it does not validate the fields, it is as if the function was simply not called.…
-
1
votes0
answers103
viewsGet DPI definition of image extracted from PDF
I’m using the itextSharp to extract images from PDF files. I used this code as a basis: https://psycodedeveloper.wordpress.com/2013/01/10/how-to-extract-images-from-pdf-files-using-c-and-itextsharp/…
-
1
votes0
answers65
viewsValidate URL hidden in html tables with C#
Good morning, I am developing a bot to capture certain information within the court site of a state, but according to the validation of the pages that is made per year I came across the following…
c#asked 6 years, 7 months ago Jonathan Igor Bockorny Pereira 111 -
1
votes1
answer88
viewsIs it possible to create a column in LINQ?
I am trying to turn the following query into LINQ SELECT [nu_ano] ,[nu_mes] ,[id_projeto] ,[id_fase] ,'Financial Progress ("Competência")' as ds_categoria ,'Baseline' as ds_curva FROM…
-
1
votes1
answer124
viewsAccessing via Curl
I have the following challenge: Log in to a website with the following data: POST */kodoreq.php HTTP/1.1 Host: eofclub.in Cookie: logado=sim User-Agent: Lynx/3.15…
-
1
votes3
answers78
viewsMensagebox is in loop
When starting my project WinFormsi define focus on a component lookUp Edit of DevExpress who owned an event Leave. The goal of this focus is to make target selection mandatory. The initial value of…
-
1
votes2
answers128
viewsHow to separate records into blocks for parallel processing?
I have a table in SQL Server that makes the control of messages to be sent and a routine in C#, configured in a Cron, which selects pending messages, sends and marks as sent. What I’m implementing…
-
1
votes1
answer165
viewsHow to use Include for objects that are inside a list
I have the following objects in my EF6 context. public class Produto { public Guid Id {get;set;} public string Nome {get;set;} } public class VedaItem { public int Item {get;set;} public float Valor…
-
1
votes1
answer143
viewsCall AXIS service with C#
I need to consume this service in a C application#: https://tidigital.voegol.com.br/arsys/WSDL/public/ars-tidigital/GOL_Requisicao But I can’t add it as a reference in the project. In trying to do…
-
1
votes0
answers57
viewsQuestions with database modeling
I’m creating a small project and I don’t have much experience with databases and having difficulties modeling their tables. The project consists of an output manager, where we will have normal…
-
1
votes1
answer24
viewsHow to page the Iamazons3.Listobjects method?
The method IAmazonS3.ListObjects that you can check out here limits the return by 1000 items per request but does not say if it is possible to make pagination, I have Buckets with more than 10…
-
1
votes1
answer25
viewsError while receiving Picker content
I have a client register and I need to change the registration of the same at some point, but to make the change I have to deal with a Picker field, only it is a mistake when I try to bring the…
-
1
votes1
answer430
viewsType conversion error when saving to database
My project has a form frmAdicionarProduto to add products to the database containing TextBox and ComboBox: txtProduto txtQuantidade cmbTipo txtValorFornecedor txtValorFinal txtLucro I’m having…
-
1
votes0
answers145
viewsHow to hide Properties in Datagridview
How can I hide my properties from my base class. I want to hide the properties in the act of loading the Datagridview from the class person, perhaps with a syntax similar to [DisplayName("Titulo")]…
-
1
votes0
answers70
viewsCast for LINQ decimal?
Since there is no Convert.ToDecimal() in language SQL, how could I transcribe a as decimal(18,2) in LINQ? I tried through the decimal.Round() but it’s not working. I have the following query on SQL:…
-
1
votes1
answer124
viewsNullreferenceexception in Winforms code
I believe it’s a bug not the code, but the compiler... When I eat this area of code, the error always goes to the next variable, or method. Behold: Part of the code: grpBoxMDeck[i] = new…
-
1
votes1
answer385
viewsSave Register in Bank with Entity
Dear colleagues. I’m developing an application C# Winform with database SqlServer and Entity framework. As I am inexperienced, I have been learning through the Internet. I’m having a hard time…
-
1
votes1
answer325
viewsXamarin Forms - Error CS1061
How to resolve the error CS1061 in the code below: Code to open a local webview on each Xamarin.Forms platform public partial class MapViewDetail : ContentPage { public interface IBaseUrl { string…
-
1
votes2
answers257
viewsAdd gridview dynamic checkbox
I am adding the gridview fields via code, but the checkbox does not appear, instead the check box appears: "System.Web.UI.WebControls.CheckBox" Go on like I’m doing: CheckBox check = new CheckBox();…
-
1
votes1
answer591
viewsBring forward an already open program - C#
I have a program that, when trying to run, and is already open, it sends a message that it is already running, but, I wanted to know a way to bring the program forward when I try to open it. Code:…
c#asked 6 years, 6 months ago Lucas Bittencourt 959 -
1
votes1
answer68
viewsList C# missing what has already been added
I’m a beginner and I’m developing a shopping cart. The routine I thought was: Every time I click the add button, the product is sent to the controller via ajax request. I already have a list created…
-
1
votes1
answer36
viewsJquery Selector in a User Control, within a gridview
Good afternoon, I have the following code: <asp:GridView runat="server" Style="border: 0px !important;" ID="gdvDadosHistoricoMedico" OnRowDataBound="gdvDadosHistoricoMedico_RowDataBound"…
-
1
votes1
answer66
views -
1
votes1
answer441
viewsIOC - No constructor without parameters has been defined for this object
I’m doing a project and they’re layered apart, I call it DDD. But I’m making the following mistake: No constructor without parameters has been defined for this object. I’m using Ioc, follow below as…
-
1
votes0
answers179
viewsNull incoming id in Asp.Net MVC controller action
I have a list of requests(Vr), in this list I created a button to finalize this request(Open Mv). When I click this button, I am redirected to my Low view, which has its own attributes, plus the…
-
1
votes0
answers33
viewsHow do I access the Ids that are inside a Gridview?
Example: I want to take the amount that was typed into this TextBox and as soon as I trigger the button event bthResposta I can recover the same to be able to set the class properties./ Obs. To…
-
1
votes1
answer141
viewsAutomapper and List Problems
Guys, I have the following code: List<NFE_CABECALHOEntity> lista = new List<NFE_CABECALHOEntity>(); Mapper.Initialize(cfg => { cfg.CreateMap<NFE_CABECALHO,…
-
1
votes0
answers37
viewsHow to recover parameters from a google maps API (within IIS) that is outside the ASP.NET-web form project
I use a Google Maps API inside the IIS outside my ASP.NET web form application, I need to recover the coordinates and return to the previous page of my project. The problem starts there, I have a…
c#asked 6 years, 6 months ago Marco Sales 11 -
1
votes1
answer517
viewsRoute.config of website in c# Asp.net
I’m building a website. But there’s one issue I can’t resolve. I have a Home Controller, where I have all the Views of the site. For example, I enter and when I click one of the images to go to…
-
1
votes1
answer188
viewsError while initializing database on server in Asp Net Mvc!
I have a finished application developed in C# using Asp Net MVC. On my local server the application connects to the database that is on the server of the company that I work, so when putting the…
-
1
votes1
answer1085
viewsdoubt c# label show
I am doing a job that consists of entering 2 values (c#) and tell what the greatest that I could do (as message) but I can not do to insert in label properly anyone can help me? using…
c#asked 6 years, 6 months ago Pedro Sobral 19 -
1
votes1
answer40
viewsError debugging webservice (asmx) locally in Visual Studio
I’m trying to locally debug a webservice (asmx) from Visual Studio. When trying to create the connection to the database, the following exception occurs: Failure to request type permission…
-
1
votes0
answers64
viewsFill Textbox with Bindingsource values Move to next and Previous, last and first
Boa noite Galera, I have a problem in a project in c# where I need to navigate in a bindingSource and fill the form fields with the values referring to the position of the bindingSource, i’ve…
c#asked 6 years, 6 months ago Luiz Fernando 11 -
1
votes0
answers33
viewsChange Password on first access using Identity Asp Net Error sending Email
I’m having a problem implementing a feature. The idea is: Make the User change password at first access(Since the user is created by someone else). How I’m using the Identity, I took logic of the…
-
1
votes0
answers28
viewsHow to solve the Stackoverflow exception that occurs in the Entity Map for the Model?
In my application a Team has several users and a User belongs to only one Team (1:N), so I have the following entities: public class Equipe{ public Guid EquipeId {get; set;} public string Nome {get;…
-
1
votes0
answers62
viewsConvert.Todatetime error
I have the following code: public JsonResult salvaPaciente(string cns, string sexo, string dataNasc, string nome, string raca, string cep, string ibge, string logradouro, string endereco, string…
-
1
votes1
answer72
viewsData selected from <option> tag to pass to Model C# - MVC
I am developing an application with HTML and C# in the MVC standards, and in one of the menus I need to put a list of options in which the user will select what he wants, this data comes from the…
-
1
votes1
answer171
viewsGET Woocommerce Request with Criterion by Date - restSharp
People I’m doing an integration with C# and the Woocommerce API, my situation is the following, I can communicate with the API through restSharp and I can fetch the site requests through the access…
-
1
votes2
answers154
viewsC# MVC 5 - Run query with another query result
Folks I’m coming from PHP and learning C# MVC while I migrate the applications I have. I came across the following problem that I can’t find a solution to: This is my class that generates the menu…
-
1
votes0
answers43
viewsUpdate Error Oledb C#
I cannot use the UPDATE command more than once. (https://drive.google.com/file/d/1xyqp6rA4Rk3AvneFaUlqk6AVvjQjbtSi/view?usp=drivesdk)…
-
1
votes2
answers686
viewsHow to place a button in a textarea in Asp.net, c#?
Good. I have the following draft of a contact form done on Wix.com but I wanted to put it in my Asp.net project as well.. So far, so good : My code is this:: <body> <style> textarea,…
-
1
votes1
answer105
viewsHow do you use the UPDATE command more than once?
I cannot use the UPDATE command more than once. For example, when I do the update on id 43, sure. But when I try to finish 44, it does not finish, but 43 that gets the update.. Code: Int att,index;…
-
1
votes2
answers88
viewsForeign key in Webapi with dotnet core
Next I am creating a webapi (I am using the Entity Framework) with two classes, Course and Discipline, where the discipline has the Id of a course, I created as follows: public class Curso { public…
-
1
votes1
answer874
viewsUnit Tests in Controller mocking EF Context
I’m not getting a solution on how to test my application (mocking the EF context) EF context: public class SawluxContexto : DbContext { public DbSet<Restaurante> Restaurante { get; set; }…
-
1
votes1
answer751
viewsCS0266 error Cannot convert implicitly
When trying to make a list where you will filter only the 5 largest records by values in descending order I am experiencing this error: CS0266 error Cannot convert type implicitly…
-
1
votes1
answer721
viewsConnect to database using . Net Core 2
I am studying . Net Core 2 and I am unable to make the connection to the database. My appsettings.json looks like this: "ConnectionStrings": { "DefaultConnection":…
-
1
votes1
answer1131
viewsUse Ilogger with . Net Core 2
I am studying . Net Core 2 and I have a question. I am wanting to log error in my Repository layer and only saw example in Controller. Some specific reason for this? Follows my codes:…
-
1
votes0
answers32
viewsLine sorting error in log
I have some difficulty showing the log to the user. Show the lines in an orderly way, but when showing it appears as follows: Line 5 Line 15 Line 11 Line 45 Line 35 Line 103 I would like it to be in…