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
answer76
views.Net Core 2.2 - After publishing a Webapp, the links were not working and the generated HTML code was the same as Razor
I am publishing a Net Core Webapp (version 2.2.108) on the Smaterasp.net host in "self-contained Deployment mode". My file . CSPROJ looks like this: <PropertyGroup>…
-
0
votes1
answer81
viewsFirebase IOS token does not work... returns null value
I’m having a problem in an application made in Xamarin, I use Firebase Cloud Messaging to receive Push, but when the code generates the Token it returns null value, someone could help me? THAT IS…
c# ios firebase xamarin firebase-cloud-messagingasked 5 years, 3 months ago Oscar Augusto da Silva 1 -
0
votes0
answers114
viewsChange format Date of a JSON statement of a Controller
I have a Controller that generates an output in Json format, below indicated. The date is returning this in Json 2019-07-22T16:00:04.8579075, I want you to return 22/07/2019 16:00 { ordemChegadaId:…
-
0
votes0
answers60
viewsLambda, add new item from the MVC 5 list
I have a model where a client has one or many Systems, and a System has one or many Customers: N:M I’m having a problem adding a new one SISTEMA, for my cliente My Model looks like this: public…
-
0
votes1
answer406
viewsWebdriver Firefoxdriver, run checkbox click
I am creating a robot to log into a page, mark a checkbox and download an export file. However I am not able to run checked in a checkbox. I am using Selenium Webdriver with Firefoxdriver with the…
-
0
votes1
answer56
viewsRelationship 1:N in the Entity Framework
Good afternoon. I am studying the Entityframework and I am not managing to do something that seems to be simple but will not. ( I wanted to make a 1:N relationship between a table for a customer…
-
0
votes0
answers400
viewsWebdriver Firefoxdriver Selenium download file
I am automating the download of a file .xlsx of a website with Selenium with the FirefoxDriver but I can’t interact in the download pop-up of the site! There’s how I interact with the pop-up by…
-
0
votes1
answer49
viewsHow to upload images(several) to the Asp.net database
I have a code in asp.net which aims to upload an image to the database, and I need to adapt it in order to move several up, only I have no idea how to do that. Follows the present code: Model public…
-
0
votes0
answers61
viewsError injecting framework repository into . net core
I’m having trouble trying to inject dependency into a repository. NET framework and API . NET Core and the problem below: An unhandled exception occurred while processing the request.…
-
0
votes1
answer123
views'Iorderedequeryable<Condominium>' does not contain a Definition for 'Tolistasync'
I’m getting the following error: as in the image below: In that part of the Code: public async Task<IEnumerable<Condominium>> FindCondominiumAllAsync() { return await FindAll()…
-
0
votes1
answer48
viewsProperty with GET (Getteronly) with Iqueryable C#
I don’t know exactly what it’s called when it maps the return in the method like this, but I’ll try to explain, I have the following class for example: public class Venda(){ public decimal Valor…
-
0
votes0
answers38
viewsHow to pass Image by Image to add to the database?
I’m trying to add image to the database, how do I temporarily add object by object up, varying the object according to which index you upload? as I tried to do on line 7 I know there are…
-
0
votes1
answer50
viewsAmbiguity error Asp.net mvc
with this controller: public ActionResult Create([Bind(Include = "ImagemId,Image,ImagemTipo")]Imagem imagem,List <HttpPostedFileBase> upload) { if(upload != null && upload.Count> 0)…
-
0
votes1
answer75
viewsHow to map the returns of a Store Procedure to the properties of a class?
Viewmodel public class ClienteResult { [Display(Name ="intParc_Cod")] public int ClienteId { get; set; } public string Nome { get; set; } public string CPF { get; set; } public decimal Saldo { get;…
-
0
votes0
answers155
viewsDecimal with ASP.NET Core 2.2
I have an ASP.NET Core 2.2 project with the following configuration in the Startup class var cultureInfo = new CultureInfo("pt-BR"); CultureInfo.DefaultThreadCurrentCulture = cultureInfo;…
-
0
votes0
answers43
viewsUndefined object reference for an object instance. c#
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 5 years, 3 months ago Jonne Victor 11 -
0
votes0
answers262
viewsEF Core - "A command is already in Progress"
I am requesting a Function in the database where it returns the values to be saved, but before saving I need to make a check if there is no same data, when I do this check with EF core it returns me…
c# asp.net entity-framework entity-framework-core asp-net-coreasked 5 years, 3 months ago iago soares 92 -
0
votes3
answers103
viewsSend error for duplicate login C#
I’m implementing a login system, but I can’t send an error message to when I try to create a duplicate login. I declared the login as follows: [Index("User_UserName_Index", IsUnique = true)] public…
-
0
votes1
answer32
viewsModeling Error Asp.net Code First
I’m having an error in making an Migration... First I’ll say what I want, so you can understand, there’s inconsistency, but I’ve tried a lot and I couldn’t solve it. What I mean by this modeling is…
-
0
votes1
answer378
viewsHow to pass javascript values to C#
I have a Client class, where a customer can have several benefits as you can see in the last property. public class Cliente { /// <summary> /// Id /// </summary> public long Id { get;…
-
0
votes1
answer43
viewsHow to replace with null or blank values
Problem: When the customer clicks to send the request the system takes the product selected and the dimensions of that product. Only not all products have box or is any other feature of the same.…
-
0
votes1
answer59
viewsProblem comparing 2 lists
I have a problem, I need to make a filter with a list of strings that comes as parameter with a icollection, the visual studio accuses "Cannot Convert from List to Unidadefederativaforedor" What…
-
0
votes2
answers214
viewsHow to perform a search with an interval between one and two dates in Asp.Net Core 2.2
How to perform research with interval between one or two dates in Asp.Net Core 2.2. I have the following form below containing Start Date and End Date @using (Html.BeginForm("Index",…
-
0
votes1
answer249
viewsMount a Datatable ASP.NET MVC
I need a help on how to mount my datatable inside my Controller, from a search. First is a filter with an Optionlist that chooses csv base name, for example Base01.csv, Base02.csv and a Num_cli text…
-
0
votes0
answers54
viewsDefine Content-type Web API C#
Good morning Guys, here’s the thing, I’m creating a Web API that should receive some parameters among them a binary format image with the content-type "octet-stream". The other parameters are sent…
-
0
votes2
answers224
viewsSave legacy data in C#
I have the following classes: public class Aluno { public String Nome { get; set; } public String Ra { get; set; } public Decimal NotaB1 { get; set; } public Decimal NotaB2 { get; set; } public…
-
0
votes1
answer184
viewsError passing parameter to Sqlcommand by parameterizing table
I’m trying to pass parameter in mine select and this bursting the exception: It is necessary to declare the table variable "@p_tabela". using (SqlConnection conn = new…
-
0
votes0
answers229
viewsHow to authenticate when consuming a SOAP service?
I need to make calls to a Web Service to send some information. I did it this way: I started a Winform application I imported the address that became . WSDL in the project I imported the classes and…
-
0
votes1
answer50
viewsEnable controls after logging in
Hello...then I need a help I need to make sure that after logging in, on the login screen when you click the confirm button, the fields of the Main MDI are enabled (menustrip), that is when the…
-
0
votes1
answer122
viewsDatetime field is null when switching to controller
I have in my application a search form using Ajaxbeginform. In the same I own a data field (Datetime), and in which I am using the bootstrap datepicker. My form looks like this: @using…
-
0
votes1
answer107
viewsGetvalue() does not show value that is assigned to the variable
static void Main(string[] args) { // ASSIM FUNCIONA //var ObjGeneric = new Pessoa(); //ObjGeneric.Nome = "PAULO TADEU CHAGAS"; //ObjGeneric.Idade = 25; //…
-
0
votes2
answers74
viewsForeach repeating values when running sqlquery
While executing my foreach, he is repeating my first result in sql. For example: In doing select * from tbNome he returns Gabriel, Rafael When executing the sqlquery, he list Gabriel, Gabriel…
-
0
votes0
answers27
viewsHow to structure the partialView To make the modelBinder correctly?
I have a form that was broken using partial view, there is only one Create for all of them, and then I think there is nothing wrong, when trying to submit the form I got the following error..... `…
-
0
votes1
answer62
viewsSQL execution pouch while executing another program in transaction
I created a program that accesses my database in transaction READ UNCOMMITED. _oConn.BeginTransaction(IsolationLevel.ReadUncommitted, _transactionName); Everything that runs within that transaction…
-
0
votes1
answer246
viewsHow to show all the numbers of a loop at once in C#?
I’m seeing loop loop on C#, but i always need to press Space Bar to display each loop number, for example by typing the number 100 and need to press 100 times the Space Bar to show an increasing…
-
0
votes1
answer426
viewsThere is no Viewdata item of type 'Ienumerable<Selectlistitem>' that has the key 'Usuario.T003_FK_COORDENACAO'
I’m having a problem with Dropdownlistfor, it’s populated with database data. Controller Code. var coordenacaoList = db.VW004_LISTAR_COORDENACAO.ToList(); ViewBag.CoordenacaoList = new…
-
0
votes1
answer439
viewsPassing view data to controller with Viewbag/ how to pass jquery script value to viewbag
I have the following excerpt <div class="form-group"> <div class="col-lg-6" style="margin-left:15px"> <div class="row"> <div id="Empreendimento" class="form-control">…
-
0
votes0
answers62
viewsNotifyicon creates multiple icons that do not disappear with program shutdown
I have a Windows Form where I use the Notifyicon component. When running the software the software by Visual Studio and finish running with the stop debug button: the icon is not removed until I…
-
0
votes2
answers98
viewsCS0847 error in matrix code in C#
I’m making a simple matrix code in C# to display string values, only it appears CS0847 Error: Matrix initializer of length "3" on line 9 and did not understand what it means. using System; namespace…
-
0
votes1
answer62
viewsXamarin.Android does not update Resource.designer in C# Visual Studio 2019
When I insert a button (for example) into the file Activity Resource.desigenr.cs does not update to add the item Botao and the data (like id for example) so I can’t access it by command…
-
0
votes1
answer271
viewsProblems with Msbuild version
In the company where I work, front development is completely separate from back. Therefore, front developers do not have Visual Studio installed and rely on devs. Net to build and raise Dlls so they…
-
0
votes0
answers381
viewsProblem with Cors C# Asp. Net
I’m having enough trouble solving a CORS error. I am following the following steps: I added the CORS Nuget package to my project. I’m adding the code config.EnableCors(); in my class startUp. I…
-
0
votes1
answer63
viewsTelerik Radgrid loses paging when exporting to Excel
When I export Radgrid from Telerik to Excel, when Radgrid has many records, it loses paging. I tried to solve with rebind, but it didn’t work. Would anyone have any idea? Attached the screens before…
-
0
votes2
answers750
viewsHow to pick up *ngFor Angular 7 item
Personal I have a select where I select a company <div class="form-group col-md-12"> <select class="form-control" name="Empresa" formControlName="Empresa"> <option selected…
-
0
votes1
answer187
viewsException released when deleting registry using Entity Framework Core. How to resolve?
When trying to delete registration of entities "Patients" and "Doctors" is returned an exception. The strange thing is that for the entity of "Schedules" everything happens normally. Follows the…
c# asp.net-mvc entity-framework entity-framework-core asp-net-coreasked 5 years, 2 months ago Ramon Almeida 382 -
0
votes1
answer81
viewsViewmodel is NULL when performed a Submit in the Main View - Asp.Net Core MVC
I have a Viewmodel (FilialViewModel) who owns a property of the type PessoaViewModel. The main view is linked to the Filialviewmodel and whenever I make a Submit, the property of the Personal type…
-
0
votes0
answers62
viewsModelstate invalida
I have a class called, Colaborador. and the collaborator has a bank. public class Colaborador { public virtual Banco Banco { get; set; } public Guid? BancoId { get; set; } } my problem, is that even…
-
0
votes0
answers126
viewsSystem.Aggregateexception C# How to resolve?
I’m trying to make a connection with a webservices but I’m having the following error: System.AggregateException: 'One or more errors occurred. (Message part…
c#asked 5 years, 2 months ago Fabio Burda 11 -
0
votes0
answers23
viewsIgnore class attributes using Datamember C#
I’m trying to return a json from a controller by ignoring some of the fields in it. Controller: [HttpGet] public IActionResult Get() { var result = _service.Generate(); if (result == null)…
-
0
votes1
answer221
viewsUnable to convert int to string C#
I created this read GET from the database, but when I read the id, it gives the following error "Cannot implicitly convert type 'int' to 'string'", it is telling me that led.id must be string? it’s…
c#asked 5 years, 2 months ago Andre Lino 95