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
answer241
viewsSendkeys does not work on the machine that will run
I am doing an automation that is necessary to give a Sendkeys but when I run it on the other machine that will run the automation it does not do the function. DirectoryInfo diretorio = new…
-
1
votes1
answer519
viewsRedirect Http to Https on IIS
I’m setting up a server IIS to run an application asp.net core 1.0 but the application is https and by typing www.dominio.com.br it does not redirect to the https, I have already made the following…
-
1
votes1
answer369
viewsLinq - filters between dates
I have a method which returns records from the database filtered between dates, and is built as follows: public List<ProcessosInformacoesAnexos_Model> DevolveTodosAnexos(DateTime dataInicial,…
-
1
votes1
answer284
viewsLoad database information into a textbox using the layers template with C#
Good morning, everyone! I’m new enrolled in the forum, but I’ve been following them for some time, I’m finishing a college TCC in C# (Visual Studio 2017), and I’m having a hard time in the project…
-
1
votes1
answer40
viewsDatabase occupied
public List<R> GetA(DateTime dataMov) { connection(); List<R> menuList = new List<R>(); try { con.Open(); using (SqlCommand cmd = new SqlCommand("SELECT r.nome,r.cos,r.estoque,…
-
1
votes1
answer31
viewsCall action after a notification
On my index I have this @foreach (var item in Model) { @Html.HiddenFor(modelItem => item.id_regional) <tr> <td> @Html.DisplayFor(modelItem => item.ds_regional) </td>…
-
1
votes1
answer58
viewsCorrect way to bind a Datagridview
I’m bindando one DataGridView in a DataTable what a comeback from my comic book, but even with just 79 records in the DataTable my DataGridView is very slow to work and catching on the screen…
-
1
votes1
answer107
viewsFeed from the list c#
I have a list in my code that is fed as follows: string Recursos = "E-mail, Desktop, Datasul, Aptus"; string[] RecursoArray = Regex.Split(Recursos, @"\W+\s+"); List<Ti01> ListaRecursos = new…
-
1
votes0
answers83
viewsError connecting running Query in Mysql + C# - Visual Studio
I’m trying to make a connection to the Mysql database through Visual Studio and I’ve already added the database in the Server manager, tested the connections and it all worked out. The problem is in…
-
1
votes1
answer79
viewsStatuscode = 407, Reasonphrase: 'authenticationrequired under development only
I have an ASP.NET application that accesses a remote server (outside the company domain; external URL) to verify some data. When I run the application on development environment - localhost…
-
1
votes0
answers42
viewsForm does not appear on google maps in expanded mode
I’m a beginner in javascript and css. The program was developed in . net vistual studio. The problem is this: I have a page that has a map where I make a circle in a region of it. The behavior that…
-
1
votes1
answer66
viewsDefault value in Select List . net Core 2.2
In my system I have a select which returns the recorded data in your database table, the problem is that the list already starts with the first record automatically, and I need her to return a…
-
1
votes1
answer587
viewsOpening PDF in new tab using ASP.NET
I am testing the code below, but there is no action when I click button to open a PDF in new tab. You’re missing something below? Test.aspx Clique <asp:LinkButton OnClick="linkPDF_click"…
-
1
votes1
answer123
viewsJsonproperty(Propertyname) does not recognize and assign values to the object
I’m creating a API, POST method, where the payload consists of 3 classes with the following structure: //Classe principal do payload public class Representante { [JsonProperty(PropertyName =…
-
1
votes2
answers87
viewsHow to get a return from a Webapi Exception?
I have the following method that makes a request for Delete to my WebApi: [HttpPost] public async Task<IActionResult> Delete(int id, IFormCollection frmCollection) { HttpClient httpClient =…
-
1
votes1
answer99
viewsHow to make the Return Ok<Object> take multiple arguments
Good afternoon guys, I would like to ask you a question, I am creating a method within a webapi in Asp.net mvc to receive some data from the launch of a home visit, but I’m having an error in Return…
-
1
votes1
answer41
viewsValidation Input Aspnetmvc
As I do to validate in the Exit of an Input, I already have the function that returns bool, if it returns false, I can’t let go of the seller.snome field and present an alert message. <div…
-
1
votes3
answers652
viewsWeb API does not return JSON
made a web api c# where by default returns xml, tried from various internet methods turn this return to json but when I make a request keeps coming in xml, someone could help? method giving the…
-
1
votes1
answer285
viewsError with modal using Partialview Asp Net Core 2.2
I’m getting the following error in my project: Invalidoperationexception: The model item passed into the Viewdatadictionary is of type 'System.Collections.Generic.List`1[Helpdesk.Models.Suppliers]',…
-
1
votes0
answers60
viewsReading real-time serial port in csharp
I am trying to perform a control where I receive information sent by Arduino. This information is of the type string and format VX1.987or VY0.123 and are sent at high speed. After being filtered and…
c#asked 5 years, 2 months ago Jose Paulo Serra 21 -
1
votes1
answer268
viewsRegistration with Modal and Partialview . Net Core 2.2
In my project I created a button for registration, which calls a modal that is inside a PartialView. The objective is to register through this modal the data informed in the database, the problem…
-
1
votes1
answer453
viewsHow to hide email address
I’m making an algorithm that sends emails, I’m able to send emails normally, but I wish I could hide the email address of the person sending to the recipient. Obs: when I say hide the email address,…
-
1
votes1
answer121
viewsSet existing value in combo box C#
I am passing a completed DTO object to an editing form, through the event click on a Change button. In this edition form, I want all fields to be filled out as soon as it is opened, but the fields…
-
1
votes1
answer44
viewsProblem in LINQ Query
In my job I need to return a list of a query LINQ. I have an expression that depending on some conditions she adds up Where to return this function. Follow the code: public HttpResponseMessage…
-
1
votes1
answer1726
viewsHow to check if a Date field is NULL C# ASP.Net
I have a webservice where I make a query in a table of my bank where I have a column of type Datetime and I am wanting to make a check if this field Datetime is filled or if you are NULL I’m doing…
-
1
votes1
answer160
viewsGeocoordinate does not contain a definition for Getdistanceto
I’m trying to make an algorithm that calculates the distance between two points from their coordinates (Latitude and Longitude), in my researches I ended up coming across Geocoordinate…
-
1
votes0
answers42
viewsWindow appears hidden behind google maps in expanded mode
I am developing a webpage using the languages Asp, c#, javascript with Telerik framework. When I am on the map in expanded mode, I circle a region of the map, and I click on the button of that…
-
1
votes1
answer62
viewsHow to create extension methods in Kotlin
Hello, I’m coming from C# to work with Kotlin and C# when there was any code that was used constantly, it was common to create extension methods that worked as shortcuts to it. Ex: namespace Test {…
-
1
votes1
answer87
viewsDeclare a class as attribute or implement Abstract?
You have LG branded television. in this scheme I can have different types of televisions and different types of electronics (so that the system can grow and I can use it not only for the tracking of…
-
1
votes1
answer212
viewsSELECT with SQLITE and Xamarin.Android
I’m trying to run a database check, but it’s not working. I still don’t understand how to do the research based on a criterion, using Sqlite and developing the application using Xamarin.Android. The…
-
1
votes2
answers868
viewsError: Incorrect decimal value: ' for column 'Value' at Row 1
I’m having a problem inserting a die of a maskedTextBox in the Mysql database. Follow the error Incorrect decimal value: ' for column 'Value' at Row 1 The code is this: conexao.Open(); MySqlCommand…
-
1
votes0
answers128
viewsDisengage Identity and handle Identityuser in the domain - Asp.net Core MVC 2.2
I want to implement Identity on my site, but not the way it comes in the MVC template with auth Individual from . net core 2.2, because I want to handle the Identityuser class on my domain, so that…
c# asp.net-mvc asp.net-core asp.net-identity identityasked 5 years, 2 months ago Márcio Sebastião 769 -
1
votes1
answer52
viewsIncorrect visualization of items in POO code in C#
My code it needs to receive the values of three books that are code, title, author, publisher and value. Only that the view is confused. The impression that nome do livro 0: q // Devia mostrar livro…
-
1
votes1
answer104
viewsC# Error When Deserialize Json for Object
I’m making a mistake when I take the return of a REST service and try to deserialize to a C object#. The REST Service returns me to the following structure(json): { "Marcacoes_Ponto_Response": {…
-
1
votes0
answers59
viewsHow to use hexadecimal write on serial port
I have a java routine to print on a serial port. I need to pass this routine to c# are very similar, but I believe I’ve bumped into some differences: byte btCmds[] = new byte[200]; stValue = "748";…
-
1
votes1
answer47
viewsWhy can’t I map using Automapper?
I have a model called Client with many attributes and (for simplicity I put here only a few) I thought of creating Viewmodels to simplify the display of data in Views, the problem is that the…
-
1
votes1
answer205
viewssearch by ID for each item in the list
I have a class called Attending. in it I have the following attributes: public class Atendimento { public Guid AtendimentoId { get; set; } public Guid? ResponsavelPorAtender { get; set; } public…
-
1
votes0
answers69
viewsError Performing Update on Entity Framework
I have the following relationship between Agenda and Contact: An Agenda may have N Contacts; A contact can be in N Agendas; In other words, I have an N:M relationship between the Agenda and Contact…
-
1
votes1
answer158
viewsEntity Building and Corporate Ownership Modeling in the DDD CQRS standard
I am creating an ERP type application, and I am using the DDD CQRS Standard, where at the initial moment of the project I am creating the entities of customers, suppliers and carriers, where they…
-
1
votes0
answers90
viewsEntityframework error
Could someone help me ? I’m trying to do Codefirst and when I execute the command I get this error: The 'System.Data.Entity.Internal.Appconfig' type initializer triggered an exception. My Appconfig…
-
1
votes0
answers71
viewsMoq in c# methods of different classes
Good night. I’m new to unit testing. I’d like to ask for help to resolve a question. I have the following method of a class that calls the method of another class: class public Teste: ITeste {…
-
1
votes2
answers342
viewsUse of the unassigned local variable of two strings in C#code
My code should be entered the gender of a person, height and age of a person in a repeat loop for 10 people. The code must show the greater weight, lower weight, average height of 10 people, the…
-
1
votes1
answer24
viewsAzuread and Identity authentication in the same Project
Applying: Built in . NET Core 2.2 Is it possible to have two forms of authentication in a single C# project? I found myself in the following scenario: 1 - Users who are employees of the company use…
-
1
votes1
answer35
viewsBring value Dropdownlist ASP.NET MV5
I’m bringing a dropdown of a table of Physicians in the View and it brings normally, but I want to take the value of it (Selected name) in the jQuery to bring other information after selected. But…
-
1
votes1
answer57
viewsData-Bind and Onclick on the same button
I have a button that has a data-bind, calling a function JS that is working perfectly. However, I need to call another function on the same button, only on C#, in class CSS of my page, if I leave…
-
1
votes1
answer227
viewsProblem running web application . net with oracle. Duplicate key
Good afternoon, I implemented a Mvc app that uses Oracle access through Oracle.Manageddataaccess version :4.122.19.1. But received the following message from IIS when running the app: Erro de…
-
1
votes2
answers2067
viewsMerge two lists c#
I have 2 lists and would like to join them in a single list to be listed. I created two lists because both present different conditions of the query and I could not relate them in a single list.…
-
1
votes2
answers1559
viewsCS0029 Error - Cannot implicitly convert "int" to "bool" as a function of C#
The code receives a user number and print if it is positive for True and if it is negative for False, only that there is a mistake of types going on and I don’t understand how to solve. using static…
-
1
votes1
answer38
viewsWhy do colors stop changing from the totalTimer = 300 +/-
Basically with this code I’m trying to make the color and emission color of the object change systematically at a predetermined time, but whenever the totalTimercomes around the value of 300 colors…
-
1
votes0
answers40
viewsAutomatically create folder in Csharp project with audio files
I have a project in C#, created a folder in the project by Visual Studio 2019 and put 2 Ogg’s there. The structure is as follows: App Assets Files (this is the folder I put the audio files in) Model…