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
votes2
answers366
viewsReturn an object from two or more tables to the fields
I have done some posts on Rest and Lambda, and to give a close on this subject(I hope), I have a question. A colleague here at the site recommended that I create a DTO and bring the database data…
-
0
votes2
answers77
viewsError in the Ienumerable
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; namespace Rotas.Models { public class…
-
0
votes1
answer48
views -
0
votes1
answer48
viewsDeployment only works with Samsung J5 smartphone plugged into the computer
I can only do implantation when my cell is plugged into my note. If I use the pattern(VisualStudio_android-23_arm_phone(Android 6.0 - API23)), does not work. Build successfully, but deployment…
-
0
votes0
answers156
viewsAssembling report with Reportviewer in C#
I have two tables in the database that are Purchase and Purchase Items. How is it possible to make a report using Reportviewer . rdlc that stays with the following pattern: Dados da Compra Dados…
-
0
votes0
answers52
viewsHow to write a text file by clicking on a Datagridview?
I have a DataGridView and by clicking on that DataGridView I have to write a file select comparing one column of a table to another column of another table and what results from that select is what…
-
0
votes1
answer922
viewsError: Validation failed for one or more entities. See 'Entityvalidationerrors' Property for more Details
The following error occurs when I try to insert data into the system: Validation failed for one or more entities. See 'Entityvalidationerrors' Property for more Details. It turns out that the…
-
0
votes1
answer610
viewsValue comparison
I need to make two comparisons as the person enters data: Higher height; OK Shorter height; (turned bad) I cannot use vector in this case, because it is a requirement of exercise. In this case I was…
-
0
votes1
answer54
viewsError loading database information to a datagridview via Entity Framework
My project has four classes: public class Manifestacao { public long Id { get; set; } public string NumeroChamado { get; set; } public string DataHoraReg { get; set; } public Cliente Cliente { get;…
-
0
votes1
answer37
viewsError while deleting file on Windows Mobile 6.5
I am working on a project for windows mobile 6.5. I am using C# com Compact framework 3.5 (CF 3.5) and the SDK for Windows Mobile 6.5. My routine records files in a temporary directory for further…
c#asked 7 years, 2 months ago Alexandre Cavaloti 2,225 -
0
votes1
answer113
viewsLanguage used by a VMIX application title designer
What language is used to work with Title Designer? This title works with an application that I use in my daily life at work. If possible any book that serves as a reference for study of it. Code…
-
0
votes1
answer242
viewsPicking up a json string
I’m having doubts I’m consulting an api and it returns me this: "{\"optimized\": null, \"optimized_slo\": null, \"normal_slo\": {}, \"normal\": {\"estimated_cost\": \"28.40\", \"distance\": 10198,…
-
0
votes1
answer67
viewsTotable method is not recognized
Contextualization I am starting in ASP.Net CORE and, to consolidate the knowledge, I am trying to make a small project already using this framework. However, I am having trouble mapping my domain…
-
0
votes1
answer70
viewsForeach or for by invoice item
I need to do one foreach per item in my code only I’m not able to accomplish. Ex.: I have a note that has 2 items, and I need to read the information of the note per item, I read item 01 and then I…
c#asked 7 years, 2 months ago Junior Guerreiro 617 -
0
votes0
answers140
viewsQuery with special characters in an Observablecollection
I created a search method that receives a text, and searches that text in a ObservableCollection pre-filled. private void btn_Pesquisar_Click(object sender, RoutedEventArgs e) {…
-
0
votes1
answer482
viewsConvert float, double or single value to Datetime
I was having trouble Cast when running a lambda and serializing for the service. Well, the solution was to pass everything to String and I got it. On the other side(Android App) I pick up and do…
-
0
votes2
answers608
viewsError Object Reference not set to an instance of an Object in c#
I’m in trouble, when I register my route it appears an error at the time the system will make the comparison to see if the Numcarroid that is in Dropdownlist is the same that is in the bank to can…
-
0
votes1
answer798
viewsDifficulty with listview layout on Xamarin.Forms
See this image My layout is broken. See that the client name is: Sebastiao Loureiro de Almeida and in the listview appears Sebastiao and it is noticed that the rest of the name gets further down,…
-
0
votes1
answer48
viewsIf it has no value to compare, save without comparing
I’m trying to make my application save if it has no value to compare, however you are always going through the comparison, I tried to put an if but still problem, this is the class that makes the…
-
0
votes1
answer49
viewsWhat is the best way to save multiple image links in a database?
List<String> _lista = new List<String>(); [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(Veiculo veiculo, HttpPostedFileBase[] file) { for (int i = 0; i <…
-
0
votes2
answers498
viewsHow to use if Else in the code below
Starting I type the artist’s id and the other data, then I will enter the repairman’s id, I need that when typing the repairman’s id, if it is equal to the artist he should not accept and ask for…
-
0
votes2
answers544
viewsSave date and time?
I wanted to know how to save the date and time in the bank, and the time I wanted to pull automatically from the machine or server. So I was able to record the date, but the time is zero. Man…
-
0
votes1
answer247
viewsHow to encrypt to a . txt file in Windows Forms C#?
I have a job to do where I need to save data from a list to text files. These figures are for the most part, password, username, idade, nacionalidade and numeroCC. At work you are asked to store in…
-
0
votes0
answers94
viewsWhat is the best approach currently to handle user permissions in ASP.NET Core?
I am currently working on a project with aspnet-core and do not have much idea how to proceed to handle user permissions. I even have an idea of how I can do it (and I’ve done it), but I don’t know…
-
0
votes1
answer69
viewsAutomatic line filling in datagridwier
Good afternoon. I need help, I have a datagridwier and in it I have a column where I type in a product code. Now I need that when the user enters the code of a product in the cell of the code column…
c#asked 7 years, 2 months ago Junior Guerreiro 617 -
0
votes3
answers1247
viewsService does not execute controller method
This message I get in the browser or Postman "Message": "No HTTP resources matching URI of request 'http://localhost:9078/api/items/1000012105'.", "Messagedetail": "No action found in 'Items'…
-
0
votes1
answer2544
viewsHow to call an Ajax controller method using MVC5 in visual studio?
Hello, I’m new in development, and I’m developing a data entry where by zip code the user type the system search in the Mail Api and the address related to the zip code, but I’ve seen in many…
-
0
votes1
answer614
viewsSave image in database and give Restore in database with Postgresql
What is the best way to save image in Postgresql database? Currently I have an OID to save, I can use normally, both to save and to recover, but when I give Restore in my database, the following…
-
0
votes0
answers61
viewsWriting in Textbox freezes form
I have a form that has a Textbox and would like to write in it but give an effect of Typewriter so that the text is not added fully "dry". I created a method that takes the text I’d like to add and…
-
0
votes3
answers39
viewsCast error while running the Rest service
I’m making that mistake: The 'Qtde' Property on 'Itenslib' could not be set to a 'System.Double' value. You must set this Property to a non-null value of type 'System.Single'. What can cause it?…
-
0
votes0
answers17
viewsHow to leave a maskedbox
How do I leave values as real value, not a common number. I need these values to be as 2.00, if possible leaves R $ 2.00 My Controller: public ActionResult Adiciona(AbastecimentoModel viewModel) {…
-
0
votes2
answers242
viewsHttpget parameter not detected
Good afternoon guys, I don’t know why my parameter is not recognized, can you help me? The value does not arrive in c# but this present in the angle c# [HttpGet] [Route("carregarUsuarioPorId")]…
-
0
votes1
answer43
viewsHow to get the result value of divValue. result[2] in the mvc controller?
$(document).ready(function(){ $("#btnSend").click(function(){ $.ajax({ url:'@Url.Action("VerificaCep","ConsultaCep")', type: "GET", contentType:"application/json", …
-
0
votes0
answers101
viewsHow to create composite key and ensure the same property in 2 model
I have 3 model public class UnidadeNegocio { public int Id { get; set; } public string Nome { get; set; } } public class Cliente { public int Id { get; set; } public int UnidadeNegocioId { get; set;…
-
0
votes2
answers124
viewsWhat’s wrong with this loop?
I am wanting to download a.exe file from my FTP server, but there is a part of the code that is giving me trouble. Error: Invalid expression term while (CS1525) someone can tell me what’s wrong?…
-
0
votes3
answers866
viewsEntering numerical data in the database
I’m having trouble inserting into the database the field is formatted as DECIMAL(10,2)), when I try to insert the direct monetary value by Mysql works with the endpoint instead of the comma ex:…
-
0
votes1
answer387
viewsHow to make a Datagridbview column invisible to the user
Good afternoon. I have a c# theme that contains a datagridviwer, and I am populating this datagridiview directly with a database query, but it has a column that needs to be in select, but I cannot…
c#asked 7 years, 2 months ago Junior Guerreiro 617 -
0
votes0
answers37
viewsError calling a service through Serviceclient in C#
I have a part in the project (MVC that connects to BD through web services) of my company that calls WCF services this way: public static ReturnType CallWebMethod<TService, ReturnType>(String…
-
0
votes1
answer81
viewsEntityFramework DatabaseGenerated
I have a property in my model where automatically generates the Id when it is inserted in Db, but I have a specific case where I need to put the Id manually, there is some way to prevent the EF from…
-
0
votes1
answer548
viewsI cannot run an application in x86 debug mode
I’m having problems in my application, because when I compile in anycpu debug, it runs perfectly, but when I compile in x86 debug it presents the following error: System.Badimageformatexception: 'An…
-
0
votes2
answers585
viewsJsonresult display Displayname from an Enum
I’m having a problem returning the Displayname of an Enum I have the following Enum public enum TipoPessoa { [Description("Pessoa Fisica")] [Display(Name = "Pessoa Fisica")] [JsonProperty("Pessoa…
-
0
votes1
answer990
viewsEnable and disable Children gameobject c#
Well I made a script where activate and disable in a gameobject, I wanted to know how to activate and deactivate children also within this script using System.Collections; using…
-
0
votes1
answer94
viewsMethodinvoker does not update listbox C#
How to implement a timer that updates a listbox in c every cycle#; Method to create the timer: private void CriaTimer() { System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed +=…
-
0
votes1
answer85
viewsDoubt with Rest service and with put verb
I just need to update two fields of my model. At get I pass a DTO to my App. The question is: When I go to do my update(put verb) do I need to load all the property or just the one I will update?…
-
0
votes0
answers48
viewsSave text to visual
I’m trying to create a journal that has a reminder class to add only the reminder outside of the journal. Good people have a problem here at school and wanted to know something, how to make the text…
-
0
votes3
answers133
viewsCreate a means not to repeat my code
How can I create a means of simplify the code below to avoid repeating some things? I would like my code "Generates user" did not repeat itself throughout the IF. How should I proceed? if…
c#asked 7 years, 2 months ago Fellipe Signoretti Feitosa 13 -
0
votes2
answers64
viewsIs there anything in MVC that is equivalent to the <Asp:Repeater> of Web Forms?
I am mounting a form where some fields may or may not repeat, example: Course 1: Course [input text] Institution [input text] Year of completion [input text] Course 2: Course [input text]…
-
0
votes1
answer59
viewsDependencies with Entityframework C#
My question is how to use the state-class include for parents, because the city-class has no connection with parents. How to perform this sql by loading the dependencies? private void…
-
0
votes1
answer176
viewsTCP Server Connection (127.0.0.1) Why are you crashing on this line?
I’m trying to create a chat with client and server in c#, but I’m having trouble on this line: client = servidor.AcceptTcpClient(); //Espera conexão I’ll post my code here to see if any of you can…
c#asked 7 years, 2 months ago Paulo Ricardo 65 -
0
votes1
answer766
viewsHow to close Modal Bootstrap only when entering the server-side method?
I have a sign-up screen in a modal bootstrap, but when validating, if an error occurs or the user no longer fill in any field, the modal closes. <script> function enviar1() { if…