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
answer41
viewsXamarin Cross-Platform and "Native" Codes
Good morning, I recently started a study on multiplatform development, and now I’m evaluating Xamarin (Visual Studio 2017), but I’m having difficulty with some questions. The main one is the…
-
0
votes0
answers804
viewsConsuming Web Service with authentication - C#
Good afternoon Personal. I’m implementing a function in my system to consume data from a web service that requires authentication (Basic Authentication), but I can’t get any feedback. The question…
-
0
votes0
answers60
viewsCall PROC MVC to display the list of users who cannot register
Trying to call the PROC sp_UsuariosVariasTentativasCadastro_Result, that brings a list according to the form data. But nothing is happening. Someone can help me ? NOTE: I created all these "layers"…
-
0
votes1
answer160
viewsExecution console hangs while doing many readings in debug mode!
In an attempt to debug the code for errors, I often need to enter the requested data, but it is not always possible to reach the end of the program because the execution of the debug via "F10" or…
-
0
votes1
answer237
viewsProblem in Saving Many to Many Relationship with Core Entity Framework
I’m having trouble saving a relationship from many to many with Entity Framework Core I have the following entities [Table("quadros")] public class Quadro : BaseEntity { public bool Ativo { get;…
-
0
votes0
answers201
viewsUSB connection with Microcontroller in Visual Studio C#
I have a microcontroller programmed to send data on Visual Studio c# through the class USB Hid Net Class. I have the license to use the class already and the application ran normally on multiple…
-
0
votes0
answers52
viewsSearch first empty space in database
I have a small application in C#, which creates the automatic supplier code. I wonder if anyone knows any way of the system to search for an empty code, ex: 1 - Manoel 2 - Daffodil 4 - Mustela The…
-
0
votes1
answer203
viewsHow to generate multiple PDF dynamically through Itextsharp
I am creating a c# method in which the user enters a data listing and assembles a pdf document for each data entered. I’m using the iTextSharp library. On the first data it generates the PDF as…
-
0
votes0
answers39
viewsOne-to-zero mapping with Entity framework
Good afternoon, I have a document table that has relationship 1 to 0 with another table of Usuario to return the user name, however I am given the error: Specified conversion is not valid. My…
-
0
votes1
answer69
viewsVariable does not receive new value
I have an object that should be "falling" over the screen several times, and it works. What I’m trying to do is that a variable called x gets an extra 1 every time this object passes through the…
-
0
votes1
answer285
viewsCommunication Problems Delphi Client Csharp Server Socket
I need to implement a communication via socket with server on Delphi and a Client in csharp. I created an example and the same does the communication but for some reason the server in Delphi when…
-
0
votes1
answer114
viewsWcf access via https
I have the following error accessing a https url: O esquema de URI do provedor 'https' é inválido; esperado 'http'.\r\nNome do parâmetro: via My file to <?xml version="1.0" encoding="utf-8" ?>…
-
0
votes1
answer991
viewsHow to join two vectors in another that does not have repeated values?
I need to make a program that reads the values of two vectors R and S, and store its values in a third vector called V. The detail is that it cannot contain any repeated element in the vector V. I…
-
0
votes1
answer114
viewsFailed to get a file. txt to download
I have a method where after a query, I create a file. txt saving some parameters. My need is to get this . txt, where I will treat this file in a Javascript (Angularjs) to download. But while trying…
c#asked 6 years, 2 months ago user108720 -
0
votes0
answers83
viewsPassing a string created in Windows Forms to Crystal Report
I needed to add a string created in Windows Forms Application in the Parameter Fields, shown in the first image below, inside the Crystal Report to later make a filter, as in the second image below.…
-
0
votes1
answer1180
viewsCannot convert Implicitly
I’m getting the following error: Unable to convert from "Tclient" to "Easysistema.Models.Applicationclient" public class ClientManager<TClient> { private ApplicationDbContext _context; public…
-
0
votes0
answers40
viewsPass parameter to new MVC controller
I need to pass parameter "01" of http://localhost:5934/Gestaodeservicos/Catalogo/Cadastro/01, to another controller. namespace Intranet.Presentation.Areas.GestaoDeServicos.Controllers { public class…
-
0
votes1
answer44
viewsMenu call does not enter Action
I have this menu in _Layout.cshtml @if (Response.Cookies["UserSession"]["UserRole"] == "Rh" || Response.Cookies["UserSession"]["UserRole"] == "Admin") { <li> <a href="#"><i class="fa…
-
0
votes2
answers234
viewsSelectedvalue error of a dropdownlist in ASP.NET
I have an Asp.Net form for vehicle registration, where there are DropDownList which are filled with database data. However, clicking Save returns the error System.Exception: 'Unable to record…
-
0
votes0
answers82
viewsHow to log a log through log4net when using the Task Scheduler to start a console application?
I compiled a console application in c# that has log4net (which is already working normally when I run the app) and configured through Windows Task Scheduler to run the application console every day…
-
0
votes1
answer147
viewsRegister Header in a SOAP service reference in C#
I’d like some support. I’m in serious trouble with a client. I have a C# application that fetches data from a system and sends it to a SOAP service. It turns out that this SOAP service requires a…
-
0
votes0
answers117
viewsProject with MVVM architecture
I’m having some doubts regarding the MVVM architecture. I am developing a project that has the following characteristics: - Main form with dynamic content - Main form generates some tabs according…
-
0
votes1
answer418
viewsTake the directory of the executable and save image in a folder inside this directory
I needed to take the path of the executable and save in a folder inside the root directory where the ". exe", serving both the file programming in the "bin" and "debug" folder and when creating the…
c#asked 6 years, 2 months ago Malyster Snur 7 -
0
votes0
answers108
viewsTwo Viewmodels in one View
I have a problem, let’s explain: I have a page called Index where I re-address all the clientes from my database in a table, in this table there is a delete button that opens a Modal de Confirmação…
-
0
votes0
answers56
viewsHow to call methods so that they have a delay?
I have a class: public class Robo { public async Task Ligar() { /* * Algo que pode demorar ou nao depende do status do robo * */ } } public class TesteRobo { public void Main() { List < Robo >…
-
0
votes1
answer206
viewsUsing Identity with Entity Framework to relate one-to-Many methods to other tables
In my scenario a user has several craft and a vessel has several notes. So I need to relate the user to the vessel so that this user can see these notes. I’m using the MVC 5 project’s default…
-
0
votes0
answers58
viewsUpdate of Telephone Array in the database
I’m trying to update information in my database where I have 1:N amid Clientes and Telefones, but I am not able to perform such update, because sometimes it will be necessary to remove a phone that…
-
0
votes1
answer220
viewsButton created Dynamically does not fire Asp-action - core 2 MVC
I have a cshtml (view) on this page I use a typed template and inside I use a POST form, I create a div(dinamicamnete with ajax) with some components, ALL appear normal, but the button to fire an…
-
0
votes0
answers41
viewsMigration does not run on EF Core 2.0
When Perform Add-Migration Init no message is shown and Migration is not performed and the prompt is in the state again PM> I checked that you are taking Entityframeworkcore.Tools 2.0.3 instead…
-
0
votes1
answer287
viewsWhen Generating PDF with Rotary viewPDF does not display - error 404 - Works Only Local
I’m trying to generate a PDF with Rotary, I can normally on Local, but when I publish it displays error 404. I’ve already added Dlls to the project. public IActionResult…
-
0
votes0
answers143
viewsSet monetary value field correctly in Asp.Net MVC
I am having problems with monetary value in my Asp.Net MVC application and would like to know how to set up In class [Display(Name = "Valor Produto")] [Required(ErrorMessage = "O campo {0} é…
-
0
votes1
answer234
viewsHow to Get Client-Side Data to the Server
Hello. I developed an application in . NET CORE and the access page will pick up the geolocation of the client with the coordinates of Longitude and Latitude. However, I made this code using…
-
0
votes1
answer129
viewsc# how to store data from a text box from the first run
I’m making a bakcup program in mysql database. I have a screen where or logo with server, user, password and port used in the bank. But I don’t want to keep typing every time I run the program, so I…
-
0
votes1
answer48
viewsTaking data from the Entity framework database (picking up discount coupons)
Good evening, I wonder how I can do by ajax to it go through my bank and see and there is a discount apply code: DAO: public void Adiciona(Desconto desconto) { using (var context = new…
c#asked 6 years, 1 month ago Bruno Reis 1 -
0
votes1
answer1053
viewsUsing Selenium how to select two different elements that have the same ID?
My attempt with xPath or by ID was unsuccessful. var options = new ChromeOptions(); options.AddArgument("--disable-gpu"); var chromeDriver = new ChromeDriver(options);…
-
0
votes0
answers35
viewsAndroid TCP client does not work
Good Afternoon, I’m creating an application in android studio to send a string from smartphone to pc. My application has the following code: public void Send_Command(View v) { testClass();…
-
0
votes0
answers34
viewsPoint in Model Class attribute is possible?
This is an xml request schema for a Webmethod: <RetrieveClienteRequest> <model query=""> <keys query="" > <cliente.cnpj type="String"></cliente.cnpj> </keys>…
-
0
votes0
answers43
viewsWebbrowser control accumulating memory with every use of the Navigate method
I created a program that uses Webbrowser to search for information online (Log in automatically and later bring the page information to the program). The program works perfectly, but it turns out…
-
0
votes1
answer70
viewsDisplay product output of two variables with dots instead of comma (c#)
I’m solving an exercise in which it is necessary to declare an employee’s number, how many hours he works and how much he earns per hour, then the system must display this employee’s number and…
-
0
votes1
answer79
viewsAlternative to Unit of Work + Repository for Dbcontext sharing
I’ve seen many times people talking that it makes no sense to use Unit of Work + Repository with Dbcontext Work unit (Unit of Work) with repository Supposedly it would be "more certain" to use…
-
0
votes2
answers186
viewsPrevent the user from using the mainwindow window while another window is open
I have a WPF application following the MVVM standard and in a certain part of the application I show a Progressbar that I implemented in a separate view for the user and, while this progressionBar…
-
0
votes1
answer112
viewsDo you need to do a controller method to get a model list method?
I have a question if you need and if yes how to create the list method in the controller (I am using MVC) follows the code in the list model: // MÉTODO PARA LISTAR RANKING DE CERTA CATEGORIA public…
-
0
votes1
answer61
viewsIt is possible to generate routes dynamically in ASP.NET MVC4
I am fixing some URL’s of my site and need to create several different routes for each page, for example: routes.MapRoute( name: "ComoVenderMinhasImagens", url: "como-vender-minhas-imagens",…
-
0
votes0
answers27
viewsHow to separate style sheets using Xamarin Forms
Hello, I am coming from WPF where it is possible to create my style files in separate files and from the same use in my UserControl's the same style settings. I did some (many) searches and found…
-
0
votes1
answer271
viewsHow to increase column width in Listbox C#
Good morning, I am a beginner in C# I have a doubt, I already searched the forum and found the solution that did not work for me. Problem: I can’t enlarge the Listbox Column. COD: using System;…
-
0
votes1
answer226
viewsHow to fill out combobox with SQL query? C#
I wonder if it is possible to pass data from an SQL query to a combobox using C#. I researched the subject and found examples, but when I adapted to my case , I could not use. I am doing this way:…
-
0
votes2
answers355
viewsExtract child tags from an XML
I am consuming a served recipe and it returns me an XML as for example: <retDistDFeInt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
0
votes1
answer91
viewsHow to call a javascript function after a webforms download
I have an aspx page with a grid and a linkbutton. When clicking on this linkbutton I call a function that hangs the screen and places a loading while downloading a file on the server, after the…
-
0
votes1
answer161
viewsFilter with SQL query from a combobox - c#
I am creating a stock program and I would like the item query to be filtered by a combobox, that is, when writing in the search field only the results related to the combobox parameter appear. This…
-
0
votes1
answer28
viewstrying to compile code
Good afternoon and good evening, everyone. I’m doing a group college project and you know that the best thing to do is to throw the code on a source code hosting platform for everyone to work well…