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
answers49
viewsHow to make the custom select of the screen "Suppliers" search information (Company name) in the table "Company"
I am developing an Asp.Net application using MVC 5. I have created one select on the Vendors screen and I would like to know how I can get the information from my bank and show them in this custom.…
-
0
votes1
answer44
viewsAccess the position of a Transform in a Unity list
I have a list of Transform that contains the Spawnpoints I have within the game, I would like to find for each of the Spawnpoints their position. [SerializeField] List<Transform> spawns; The…
-
0
votes0
answers56
viewsAndroid Binding Library Error: How to make a method return an array of Idictionary <Tkey, Tvalue>?
Hi guys, I would really like someone to help me with this error I’m getting when I import a.Aar file, in an Android Binding Library project, to realize an integration with the service of a little…
-
0
votes1
answer58
viewsAPI Rest only returns the last value
I am using ASP.Net to create a REST API I’m trying to create a method that returns a list of groups structured this way: { "IdGroup": "1", "NameGroup": "Group1", "Installations": [ {…
-
0
votes0
answers53
viewsEntity Framework is not saving all information from the list
I have a problem that I cannot solve in any way with Entity Framework. In this scenario I am receiving information from the front, and then I need to save it in the database, however, when I have 2…
-
0
votes1
answer56
viewsFill Dropdownlist with Multiple Values
i am trying to fill a Dropdownlist that has multiple values, from my "Edit" action, where I recover the objects Toonmoves containing One or More Effects and how The Effects May belong to several…
-
0
votes0
answers34
viewsHow to place the path of an image with restricted length in the database
Ola, I have a string type variable that should save the images, but it has length 40 and when trying to put the error path. I have a folder in wwwroot where I store the images and want to store in…
-
0
votes1
answer38
viewsHow to Put Elses If in Layout
Ola, I am trying to put in ifs layout in order to change login to logout but it is not working. In Layout I have this code : @using Microsoft.AspNetCore.Http; @using WebApplication1.Controllers;…
-
0
votes3
answers215
viewsProblems with connectionString in ASP.NET C# CORE
I’m new to ASP.NET with C# and have a problem accessing the information on my web.config. This is the connection tag to the database: <connectionStrings> <add name="someConnection"…
-
0
votes1
answer41
viewsEntity framework Client For Sale
I’m having doubts about how to build the relationship between the Client and Sale classes, taking a look at the microsoft website, I was left with doubt if the class should have the navigation for…
-
0
votes1
answer70
viewsDelete element from string array in mongodb
Hello. I want to delete an element from a string array, in this case it is the Profiles array, which is present in the Person Document. This in an application developed in . net and with mongodb…
-
0
votes1
answer182
views'System.Data.Sqlclient.Sqlconnection' does not contain a Definition for 'Query'
I wrote a C# method to make a "switch" between different database types in my application. Where the problem is that each database type makes use of a different library (SQL => Sqlconnection and…
-
0
votes1
answer39
viewsGet x:Name of control by clicking
Hello, I have a stackpanel with a sequence of Abels and would like to capture the x:Name of the controller in the Label Mouseup event. XAML: <StackPanel Background="#FF405089"…
-
0
votes0
answers339
views"The underlying connection was closed" error in REST Httpclient C#
I’m doing a REST integration with C# used Httpclient, most of the time the data was sent successfully, but I went to investigate why some of these were returning with error, found that what they had…
-
0
votes2
answers63
viewsClientdisconnected due to error: Timeout and Ready with no player
Hello, I have a connection problem in my multiplayer project. When creating a local match, everything seems to work fine, however, the console displays the following warnings when I build and create…
-
0
votes1
answer101
viewsUpload files to Asp.NET MVC 4 - Web API - Http Put Method
So, I have to do a method in my controller for an API that accepts 2 files via PUT (1 json E1 xml for data processing, not to save the files), and I have to send the request via Fiddler.. My request…
c# asp.net-mvc asp.net asp.net-web-api multiple-file-uploadasked 4 years, 9 months ago helloCodingMyOldfriend 1 -
0
votes1
answer39
viewschange webconfig mysql+ Connection. NET
I have this site using Entity framework running normally in mysql localhost database, now I want to put on a server, I have tried to change several times the conneciton string, but it gives two…
-
0
votes1
answer30
viewsWhat kind of data in an Application Service with 3 different tables?
I have an Application Service in ASP.NET Core that will fetch the database data from a table "Employees" that are number, name, departmentname and cityname... the last two fields I mentioned are…
-
0
votes0
answers51
viewsC# files I need to send to the client (put in an installer for example)
Good night, Which files are required in my EXE distribution? The briefcase pusblish is because I clicked to publish once to test and now it is always generated every Debug or Release (If someone…
-
0
votes1
answer321
viewsHow to create an http request in c# Asp.net
I’m wanting to text through this url; https://www.iagentesms.com.br/webservices/http.php?metodo=envio &usuario=iagente &senha=12345 &celular=5199999999…
-
0
votes0
answers54
viewsNuget package does not point to the installed package
I have an app, just like a package Nuget. The package in question is the: System.Net.Http This application has the target framework set to .NET Framework 4.7.2. When checking in the project to where…
-
0
votes1
answer39
viewsName check in c# and firebase
I have not been able to find any results for my question and I will try here. So, I have a firebase database in a c# application and I was wondering if it was possible to check if the name entered…
-
0
votes2
answers67
viewsHow to use Log4net Adonetappender only at Error level
I have a console application and use log4net to display the application logs, however I would like to save only the error logs in the database. I saw that you have the configuration of…
-
0
votes0
answers71
viewsRead an image in SQL Server for a picturebox in C#
I have Bytearrays of images in a database on Mysql Server and I intend to read them and after that convert Bytearray to an image that can be arranged in a picturebox. I have tried using other…
-
0
votes0
answers40
viewsNhibernate error in group by
I’m studying NHibernate and is giving me an error in group by, but at first it is generating me wrong sql, do not know why, follow the code below SQL and its structure. string hql = "select…
-
0
votes1
answer360
viewsAppsettings.json generating with incorrect settings
Good morning! I am working on an API . Net Core 3.1. This API is divided into 3 environments, DEV, Homologation and Production. I have 4 configuration files, Appsettings.json,…
-
0
votes0
answers20
viewsError: System.Indexoutofrangeexception: 'The index was outside the matrix boundary. '
public static List<Cliente> LerClientes() { var clientes = new List<Cliente>(); if (File.Exists(CaminhoBaseClientes())) …
c#asked 4 years, 9 months ago Hélio Alexandre Venturi 1 -
0
votes0
answers121
viewsRegular expression keyword marking
Good morning! I have been two weeks evolving in the treatment of texts in Sqlserver (through CLR) with the use of regular expressions. Now my challenge is to "mark" names of municipalities so that…
-
0
votes2
answers86
viewsHow best to separate the two lists in C# by doing an operation with each side of the split
This questioning came to my head in an activity I was doing here at work. What would be the best way to do this operation? The example I bring would be say we have a T object, and we have a List, if…
c#asked 4 years, 8 months ago David Ferrari 67 -
0
votes1
answer121
viewsC# - Problems with Scriptmanager after Response
Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Comprovante.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache);. -- código de…
-
0
votes0
answers97
viewsFirebird backup on C#?
I am backing up a Firebird database on C# but is returning the following error: unrecognized service Parameter block Follow my code below string cmBackup = @"C:\Controle Escolar\Ano_2011\Banco de…
-
0
votes1
answer123
viewsPerform a Get that takes a List<long> ids as parameters
all right? I am doing a project in C# and at the moment I am doing the methods to be consumed via API Rest, my boss asked to do an Httpget that receives as parameter a List ids. I know that in my…
-
0
votes2
answers31
viewsThe use of Pushasync<Tviewmodel> in MVVM allows calling multiple pages. How to avoid this?
I have a Button that triggers a Command whose Action is a Pushasync< Tviewmodel >(). The problem is that if you click the button more than once before opening the new screen, it will open more…
-
0
votes0
answers187
viewsError executing add-Migration . Entity Framework Core
I am using version 2.2.4 of Ef core and version 3.0.5 preview of . net core sdk The mistake is : Unable to create an object of type 'AppDbContext'. For the different patterns supported at design…
-
0
votes0
answers86
viewsProblem when serializing an object
I’m trying to use serialization to transfer data between Server and Client. However, I am having trouble trying to deserialize a class that has a type List of another class, when the class to be…
-
0
votes2
answers235
viewsHow to convert MM/dd/yyyy to dd/MM/yyyy?
I think because my computer is from the USA it always saves the dates in American format, anyway, I have a Date Time Picker that on the client’s computer is in Brazilian format, but when he saves…
-
0
votes1
answer57
viewsIncrementing Progressbar with a Timer causes a Visual Bug! The Progress only carries half but the value is FULL! c#
Hi, I’m creating a project something like this: Clicko and a Proressbar appears, I increment with a Timer, I counted and qd an incremented variable of 1 in 1 reaches 11, we have +/- 3 seconds, is…
-
0
votes1
answer37
viewstake the values of an xml array
Good afternoon, I’d like to know how to add the values of an xml array to a Combox. I am using this code but it is giving me the following error: "System.Collections.Arraylist" in the Combox c#:…
-
0
votes1
answer46
viewsButton to insert records into the Database
Great, I’m running a project for my PEF that consists of creating a BD for a company. However, I decided to put a button to add records and when I click to add, the following error appears: Failed…
-
0
votes1
answer232
viewsHow to limit decimal places in C#
I made an application to calculate the arithmetic average of 3 notes. My form has 3 Textbox that receives the note and a button that calculates the average. The result is printed on a Label, as I do…
-
0
votes0
answers47
viewsSqldatareader does not return database information
This Datareader below when you type the product code it shows the name of the product in another textbox, works ok, but when instead of searching for the code search by the codebar it does not bring…
-
0
votes0
answers27
viewsDoubts regarding the use of lists in c#
In my list there are 4 items with code 711, however I just want to get an item inside that list, is there a better way to do this? Because when I fill in my append, it writes the data of the 4 and…
-
0
votes1
answer389
viewsNewtonsoft JSON Deserialize List
I’m tantalizing to deserialize a JSON file, may I’m having this error "Newtonsoft.Json.Jsonserializationexception: 'Cannot deserialize the Current JSON Object (e.g. {"name":"value"}) into type…
-
0
votes1
answer30
viewsCS0411 Unity error
I have this error in my code that I am not able to solve. the error code: error CS0411: The type arguments for method 'GameObject.GetComponent<T>()' cannot be inferred from the usage. Try…
-
0
votes0
answers78
views<input type="file" receiving only null value
I’m having difficulty my project, I have a field in my form where I pass a file to it and send to my controller, problem is that the value always arrives null, I tried several ways but, I’m not…
-
0
votes1
answer94
viewsFill GRID with JSON - Deserialized (Metrogrid - Metroframework)
I’m probably doing something wrong, and I must have made a mistake doing the loop, but come on. I have a class called 'Class.Cs' that has the following code: [JsonProperty("A")] public string A{…
-
0
votes1
answer48
viewsSend Email Asp.net Mvc
good afternoon guys, I need a help, I don’t know if I’m doing wrong more when I try to send an email, through code in the controller nothing happens, can you give me a help of what might be waking…
-
0
votes1
answer39
viewsButton to enter Records in Database
Good, I am conducting a project for my PEF that consists in creating a Database for a company. However, I decided to put a button to add records and when I click to add, the following error appears:…
-
0
votes1
answer57
viewsMake the program return to the beginning of a conditional if the condition is not true
I can’t get the program to repeat until the condition is true, I’m a beginner, someone can help me? :( Console.WriteLine("Digite sua hora de entrada"); int hours =…
c#asked 4 years, 8 months ago antonnymello 33 -
0
votes1
answer30
viewsButton to enter Records in Database
Good, I am conducting a project for my PAP that consists in creating a Database for a company. However, I decided to put a button to add records and when I click to add, the following error appears:…