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
votes0
answers211
viewsHow to check customer validation on in an ASP.NET Core MVC 2.0 application to recognize EN standard
I’m having trouble setting up client-side validation gift my app. I’d like customer validation by using jquery.validate.unobstrusive, accept numbers and dates located in. I have already made this…
-
1
votes1
answer81
viewsC# - Check if dates are missing in the selected period
I have the following SQL SELECT dt_finished::date AS "DataFinalizacao", count(DISTINCT tba.id_batches) AS "Quantidade Total" FROM tb_batches AS tba INNER JOIN tb_routes tro ON (tro.fk_id_products =…
-
1
votes0
answers153
viewsEntity Linq consultation in many-to-many relationship
I inherited a bank that is untouchable... despite having some very "strange" things. For example I have the following situation that would represent an n-n relationship but the relationship does not…
-
1
votes1
answer38
viewsBuild problems with Postsharp in Appveyor
I’m having trouble doing build of my project in the AppVeyor, (locally works) because the license is in regedit. I checked that it is necessary to create a file postsharp.config and inserir license…
-
1
votes1
answer1228
viewsRelationship 1 - N Entity Framework
I’m developing a test project and I’m having a problem with 1-N relationship with the Entity. Model Cab_venda: public Cab_Venda() { Det_Venda = new HashSet < Det_Venda > (); } public int id {…
-
1
votes1
answer164
viewsWebclient.Downloadfile(Address, Filename) Doubt using variable
Well, I’m creating an upgrade system, and it’s giving error in one part WebClient web = new WebClient(); string DownloadVersion =…
-
1
votes1
answer133
viewsStore / Load generic types in Redis with C#
Setting I created a function using AOP to cache information, when the method is called I store in Redis using the cache.StringSet, but when I need to capture back the value of Redis I need it to…
-
1
votes0
answers88
viewsSelenium 3.8 + Firefox 56/57 does not run on Background
I have a service currently running with Firefox 46 + Selenium 2.53. However I need to update it and I’m trying to use Firefox 56 or 57 with Selenium 3.8. When I run on my machine the service runs…
-
1
votes0
answers263
viewsHow to change the prefix and name of an attribute in an XML tag in an NFS-e?
Hello, I’m beginner in NFS-e development and I’m not able to change the prefix and attribute name below, I put in the code so that it was xsi, but regardless of what I put it generates the xml with…
-
1
votes1
answer731
viewsOnchange function does not work
Good afternoon, I have a function that checks if the typed email exists in the bank, and if the email is valid. Follow the function: <script type = "text/javascript" > function…
-
1
votes1
answer1545
viewsError sending information to Webservice: System.ServiceModel.Security.Messagesecurityexception
I created a simple web service that sums up two numbers and returns the result. O IIS left configured as windows authentication enabled and the other disabled. Code:…
-
1
votes1
answer287
viewsUpdate console line with C#
I already asked this same question once, but in that case I needed for the python language, now I need to solve this same problem, with the C language# I have a loop in C#, and would like to inform…
-
1
votes0
answers306
viewsSearch for an item in the Aspnet mvc List
I have a controller, in this Controller has a action List, to which it returns all suppliers. In the view List, I created one input type="search". I want that when searching a name in this field, it…
-
1
votes1
answer87
viewsHelp with ASP MVC routes (3 routes for the same action)
I have a controller: public class imoveisController : Controller { public ActionResult Index(int idEstado = 0, int idCidade = 0, int[] idRegiao = null) { string IdEstado; string IdCidade; int[]…
-
1
votes1
answer47
viewsAjax autocomplete in Entity Framework
I have following HTML code: <input id="pesquisaEstilo" name="pesquisa" type="text" placeholder="Destrito, Concelho" /> <input type="submit" value="Pesquisar" id="botaoPesquisar"/> I want…
-
1
votes2
answers190
viewsIn Development Code First how do I relate the Aspnetusers table to other tables
I am developing a system for real estate and need to relate the Table Aspnetusers with the tables that the system will have and with cardinality one for many, this I want so that the system can pass…
-
1
votes2
answers1578
viewsInvalid characters in path in File.Move()
I have this code to move a file: string path = "C:\\inetpub\\beGoodToo\\videofolder\\nome.mp4"; string path2 = "\"C:\\Program Files (x86)\\Wowza Media Systems\\Wowza Streaming Engine…
-
1
votes1
answer1049
viewsHow to solve site publishing problem usitlizando IIS
The site/system will be placed on the local computer for demonstration I posted the site on IIS to be used locally on the machine, only this returning me the error: Description: Error while…
-
1
votes1
answer124
viewsShow data from a JSON in a listview
namespace Monitorizacao.UI.Pages { public class Post { public int Id { get; set; } public string Title { get; set; } public string Body { get; set; } } public partial class TestAPIPage : ContentPage…
-
1
votes1
answer549
viewsCircular relationship with Entityframework Core
I need to relate the entity Person to Personal Registration using EF Core, but is giving the following error in Migrations: "The navigation Property 'Personal' cannot be Added to the Entity type…
-
1
votes1
answer700
viewsSave data from an array to a database
I need to record the contents of an array that returned from a Json deserilization (return of a Json with more than one level), follow the line with the method that extracts the array: Departmants…
-
1
votes1
answer32
viewsMake sum of all searched data
I am making a report, I was able to make him bring me the data of specific dates, but I need now that he brings me the sum of everything that was selected, I made an attempt but does not bring the…
-
1
votes2
answers67
viewsTrying to search with specific id in a period
I’m trying to get a car specific between dates, because it works in periods, more need to get the element ID, I do not know if I would have to apply some other query or include in it, the bank I use…
-
1
votes1
answer66
viewsWhy doesn’t this redacted code work the same as the original?
I’ve been studying C++ for a while and I want to train by rewriting functions already done by me in C# only in C++. I wrote a simple code that computes a IV of a Hash, very simple even, calling the…
-
1
votes1
answer279
viewsWebclient C# finishing download before starting to download
I have a question, I am using Webclient in C#language, I have the following problem: I click on Download a file, and it does not start downloading, it says that downloading is already finished...…
-
1
votes0
answers155
viewsSaving a Lot to Many Relationship with Entity Framework
Doubts when inserting objects into the database when using Entity Framework 6 + C# WPF. I have 3 objects Ordemservico, Service and the Itensos. with the following structure: public partial class…
-
1
votes1
answer104
viewsDataconnectiondialog giving error in Visual Studio 2017
I’m migrating to the Visual Studio 2017 a legacy project that uses a modal window to collect database connection data and format a string connecting. The code below shows an error: var dialog = new…
-
1
votes1
answer99
viewsPredefined type 'System.Valuetuple 2 is not defined or Imported
I am using Asp.net mvc and in my controller, I have the code below: [HttpGet] public JsonResult salvaItem(items item) { items oItem = new items() { address = item.address, bairro = item.bairro };…
-
1
votes1
answer317
viewsPass Aspx page values to Aspx.Cs
I have an Aspx page the following code which loads a list of items. It is working, the list is displayed normally. <table width="100%" class="table table-striped"> <tr>…
-
1
votes1
answer1662
viewsEsocial - Error signing XML
Good afternoon. I am trying to sign the XML, but I have the error below: Error generating System.Security.Cryptography.Cryptographicexception file: Poorly formed Reference Element. Searching, I saw…
-
1
votes1
answer99
viewsError while trying to save data to two tables at the same time
Good morning. When updating a table my system has to save the current data in a historical table and only later save the form data in the table by doing the update. This is the action that receives…
-
1
votes3
answers3047
viewsAccessing variable in another class comes null - C# Visual Studio 2015
Hello, I know it’s a stupid question, but I’m having a hard time accessing a variable from another class. Situation: - I’m using a datagrid, which I want to take the value of one column, and…
-
1
votes1
answer277
viewsweb request and json no c#
I am working with firebase, and I am searching the server data with Httpwebrequest, I was able to recover this data in the following way; {"-L1od7ljenm8zhsps7ne":{"Age":"18…
-
1
votes0
answers51
viewsIdentify Child Control Resize
Hello. I am going through the following scenario. I have a Usercontrol that has dynamic width based on the text typed in a Textbox within it. For this in the Textchanged event of this Textbox, the…
-
1
votes2
answers97
viewsHow to assign a class to the whole and not just attributes separately?
I have a class constructor method that when called makes a query in another database class that returns me the same constructor method class(only with the assigned data), example: public Invoice(int…
-
1
votes1
answer308
viewsReturn List in a View
Hello, I’m a beginner in C# and MVC and I’m having trouble returning a data list. I have the code below and do not know how to return the loaded data from the list. Can anyone suggest me how to do…
-
1
votes1
answer44
viewsHow to Create an N:N Table where one of the keys does not belong to a table of the same database
Context: The application has a module for record of calls and we use another application handle the incident record, both are in different database. Each call can be related to one or more incidents…
-
1
votes1
answer980
viewsHow to translate the Full Calendar header schedule?
Greetings, friends of Stack Overflow! I’m one step away from completing a schedule using the fantastic plugin Full Calendar, in which I am grateful to exist. However, I am having some translation…
-
1
votes1
answer40
viewsI’m trying to dropdown html
I’m trying to implement a DropDownList in a View mine that serves for form, but I need the selected value to go to a ViewBag. This is my View there where it is "Car Selected", I would need to turn…
-
1
votes1
answer74
viewsHow to change the color of the icon inside a Rectangle - WPF
I need to change the color of my button icon to "White Color", but I don’t know how to do it. I’m using a Mahapss icon pack... I’ve seen it on the net using GRID’s Contentcontrol, but being inside a…
-
1
votes2
answers2588
viewsC# Call Controller method Asp.Net MVC5 with Ajax
Hello, I have a method called GetData() in my Homecontroller that returns a JSON, I would like to pass the data to my View, but it always comes empty, I’m starting as a developer, and I’m already a…
-
1
votes1
answer400
viewsHow to convert this Json to Objects in C#
How to convert this JSON to a C object#? { "Maquinas":{ "Maquina1":[ { "comando":"Get", "enderecoip":"192.168.254.221", "port":"3000", "usuario":"teste", "Senha":"123456" }, {…
-
1
votes1
answer1419
viewsSending notifications from Pagseguro Sandbox to local address (C# ASP.NET MVC)
I’m doing the integration of Pagseguro in an ASP.NET environment, and everything was going well until I got to the Pagseguro notifications part. As you can see in the image below, I have set the…
-
1
votes1
answer85
viewsHow to enable/disable a txt from a choice of a jquery radiobutton?
I need to enable/disable a field according to the choice in a radiobutton Validations This field should only be active when the "Inactive" radio button is selected Follows code: Radiobutton:…
-
1
votes1
answer601
viewsUpdate DIV with Ajax Asp.Net C#
I’m setting up a Dashboard for tracking tickets, in it there are basically two things, 4 fields and 1 chart. I would like to update them periodically, tried with <meta http-equiv="refresh"…
-
1
votes2
answers329
viewsWorking with Filestream and BLOB
Friends, by company order, I need to take all the files that a system stores in a Windows directory and store in the Database. In the database there is a column that stores the directory where the…
-
1
votes1
answer80
viewsStarting with Xamarin
I got interested in Xamarin and decided to test the short time, the problem is that all the tutorials I saw have the option "Portable", and in visual studio 2017 does not have, even for android as…
-
1
votes1
answer105
viewsColoring word "up" a limiter
I need to color in Richtextbox filled with multiple lines, a text before a limiter, Note for example the highlights: 1- not paint because it has no limit 2- paint because it has limit: not paint 3-…
-
1
votes1
answer64
viewsCreate nuget package from a REST web API application
I have a WEB API REST service in ASP.NET CORE 2.0 multiple projects(layers) in it. However, by larger forces, it cannot be used as a service. It was then suggested to create a nuget package for this…
-
1
votes1
answer260
viewsMigrations error loading System.Configuration.Configurationmanager - Migrations
I have a WPF project that contains a app.config containing the consection string and tb have a Data layer of type Classlibrary . dot net Standard in which the Migrations folder should be created.…