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
votes2
answers78
viewsRemove selection from a Strip Menu
I got the following Menu Strip: I would like when I move the mouse over it not to have the color blue. It’s just to be informative this and not to use as buttons. Using enable the Menu Strip turns…
-
1
votes1
answer48
viewsError after performing Migrations (backend .Net)
My backend is built in . NET, and when including a certain table in the solution, I appeared the following error: Cannot create more than one clustered index on table 'dbo. Favorit'. Drop the…
-
1
votes1
answer182
viewsQuery Linq C#
Good afternoon I have the following database structure: Tables: -User -Group -Permission And all relations N to N: Grupousuario Permissaousuario Permissaogrupo I set up a query to return the user,…
-
1
votes1
answer167
viewsDoubt with Join between two classes
I have the Classes: class Procedimento { public string CodProcedimento { get; set; } public string NomeProcedimento { get; set; } public string TpSexo { get; set; } public int IdadeMinima { get;…
-
1
votes1
answer114
viewsHow to insert float value by arraylist - C#?
Hello, I can not pass a floating value (price) by arraylist to the bank . I wonder if I need to convert before passing or if there is any way to do straight. I’ve looked it up in Stack, but I can’t…
c#asked 7 years, 10 months ago Paulo.Pasiam 11 -
1
votes1
answer47
viewsAccess to EF Core data
Doubt access to data efcore I have a table with many fields, I’m using EF Core for access, it is possible to return only the fields that I will actually use? Ex. in a listing, precise ID and Title,…
-
1
votes2
answers499
viewsSql server skipping record id
After changing an application record, the next record I entered in the table skipped 1000 increments in id. id’s 2 3 4 5 6 7 8 9 1015 1016
-
1
votes1
answer205
viewsSecurity Certificate error in Webbrowser
I’m working on a winforms program that basically uses the WebBrowser to access the website of the federal revenue using the digital certificate. My problem is the following, first of all, I got this…
-
1
votes1
answer78
viewsHide Datagridview lines by date comparison
Hello! I need to hide certain lines from DataGridView containing in the column data a date less than the current date. I found this code, but do not know how to hide the lines with this comparison,…
c#asked 5 years, 8 months ago Marlon Pereira 465 -
1
votes1
answer53
viewsCast shapes with interface
wanted to know what are the possibilities (but which one is more suitable) to do a cast with interface. public class ClasseTeste1 : IMinhaInterface { ... } public class ClasseTeste2 :…
-
1
votes0
answers36
viewsIs it possible to read Chrome Devtools data using Selenium?
I would like to know if there is any function of Selenium that allows reading data/logs from the panels of the Chrome devtools. Specifically: Read full-page HTML structure, or any specific element.…
-
1
votes1
answer1076
viewsConvert Base64 string to jpeg image in C#
How to convert a Base64 string to a jpeg image? I saw some places talking to use one with namespace System.Drawing.Image. But in my Visual Studio project you don’t see this class. I have tested in…
-
1
votes1
answer440
viewsUpload images with c# windows Forms and php
I’ve been trying to find a solution to my problem for at least two weeks and I can’t make it work. The idea is, I have an application Windows Forms written in C#, in which I will have a…
-
1
votes1
answer68
viewsWhat happens if I forget a bugger
I have a question, when I do debugging sometimes I forget to take the breakpoint, but what happens if I forget and my project goes into production? I think as are breakpoints of ide nothing will…
-
1
votes1
answer696
viewscondition to prevent textbox null
How do I make the system not allow insertion of null values inside a textbox, using id condition? if(verificar se o textbox é null){ MessangeBox.Show("digite um valor"); }…
-
1
votes1
answer111
viewsMany Exclusion for Many Entity Framework
I’m having a big problem with a many to many deletion in Entity Framework 6. Below follows my three classes. Budget class. public class Orcamento { public int Id { get; set; } public int ClienteId {…
-
1
votes1
answer1742
viewsHow to open file with window.open in a post?
My controller returns two file types: pdf and excel. return File(stream, "application/pdf"); return File(new MemoryStream(ep.GetAsByteArray()),…
-
1
votes0
answers74
viewsI can’t use two models in one with cshtml
I need to load a dropdown, but the dropdown data comes from one model and cshtml is from another model. So I created a model that was common to both of us and I decided on this model, the two models…
-
1
votes0
answers109
viewsFramework for Graphics
Good morning, I’m with a graphic that was developed using the Devexpress(https://demos.devexpress.com/XtraChartsDemos/BarViewTypes/BarSeries.aspx). In the chart I’m using it has five columns and…
-
1
votes1
answer237
viewsUnityengine.UI does not work
So, I’m learning programming and in the course the teacher put a code in the algorithm that is "using Unityengine.UI" to be able to put the commands and Talz, only when I went to do in my Unity, it…
-
1
votes0
answers60
viewsRelate more than one column to lambda Expression
I have the query below that relates only the Processoid. I need to know how to relate processes and processes lists by Processoid and Grupoid. I have consulted in several groups and did not get an…
-
1
votes1
answer38
viewsHow to Recover User Name in Botframework?
What is the C# code to retrieve the user name during the conversation?…
-
1
votes0
answers264
viewsC# How to read Nfe Send Return XML
I’m implementing communication with the SEFAZ WS. After sending the Note, I am having difficulty obtaining XML content from the return in string format and reading the Receipt.("infRec") Follow…
-
1
votes1
answer239
viewsRegex to remove HTML Entity
I have an excerpt of HTML in which I extract some information. However in one of these HTML is coming the code + in the middle, which means the sign +. I tried a few ways but no removing that…
-
1
votes1
answer147
viewsAccess Restriction, in Design of Visual Studio,com C#!
During my computer technical course, in the Programming module, I did a project with Windows Form! This project is linked to a database created by myself in SQL Server! It would be a "software" for…
-
1
votes1
answer443
viewsHow to put a List<> in a Listview?
I have a method to read my database that returns me a List<>, I would like to know how I display this List<> in a Listview component DLL dll = new DLL(); dll.listaVeiculoss(); //Esse…
-
1
votes3
answers759
viewsReplace in substring in c#
Original text: E02000000000000002DOCE LUAMAR MORENINHA 240G 00100309 00100309 I need to change for that: E02000000000000002DOCE LUAMAR MORENINHA 240G 20100309 20100309 I’m wearing this: if…
c#asked 7 years, 9 months ago Farofakids Trader 13 -
1
votes1
answer494
viewsPass value of equal properties, different classes
I need the next one I don’t know if you can do, so the question, I have two classes and in these two classes I possess exactly equal properties, as follows the examples: public class Cliente {…
-
1
votes3
answers1521
viewsCannot implicitly Convert type 'string' to 'int'
protected void btnSave_Click(object sender, EventArgs e) { List<ProdutoAmortizacaoCreditoDias> aDay = new List<ProdutoAmortizacaoCreditoDias>(); ProdutoAmortizacaoCreditoDias ee = new…
-
1
votes1
answer44
viewsC# convert Object to Object[]
I have the following code: var pagamento = new PefService.Pagamento(); pagamento.IdPagamentoCliente = "teste"; ...... //resquest.Pagamentos é PefService.Pagamento[] request.Pagamentos = pagamento;…
c#asked 5 years, 7 months ago Tiago Casanova 778 -
1
votes1
answer156
viewsWhat are the differences between Thread and Promise
I am more of the desktop world, but I’m wanting to know more about WEB. And I wonder if there is a difference between javascript and C thread#.
-
1
votes1
answer138
viewsC# Event by pressing button, not by clicking
I need to perform a function exactly by pressing the button. For the common function Botao1_Click it only executes when you release the click, I mean, if you click and hold a little time pressed it…
-
1
votes1
answer954
viewsCreate Json with a large amount of Data and Return with Webapi
Scenario: I have a Webapi that executes a method in my service layer that executes a query either returns 500k result lines, containing 90 columns. Method that makes the query and traverses the…
-
1
votes1
answer242
viewsC# calculator and keyboard interaction
Guys, here’s what I’m doing: I’m doing a C# and I wanted to put in a root calculus. The problem is that the calculation is only done with the value I put in the variable first. I can not put this…
-
1
votes1
answer500
viewsHow to pass a URL in the Parameter of an API
How to pass a URL to an API public class HTTPController : ControllerBase { [HttpGet("URL={URL}")] public JsonResult GETURL(string URL) { } } However when passing for example https://google.pt this…
-
1
votes0
answers97
views -
1
votes1
answer970
viewsDoubt about how to implement a C# Dependency Injection using Ninject
I have a C# project with Windows Forms. I have a question about how to make an implementation between two layers of my application: Application and WindowsForms. I need to carry one DataGridView…
-
1
votes0
answers329
viewsMany-to-Many Relationship Entity Framework Code First Composite Primary Keys Repeat Column
in my application I have two entities with a relationship of many to many, namely, Activity and Skill: The EF (Code First) generates for me the junction table, but it is giving conflict if I create…
-
1
votes4
answers922
viewsHow to make a combo With the days of the month?
What is the best way to make a combobox with the days of the month? That means the combo has to be from 1 to 31 days. On the HTML side I have a label called "drpDia", and I need to load this label…
-
1
votes1
answer98
viewsHow it would be possible to perform combobox search C#
I could not make the combobox enable to enter the search…
c#asked 5 years, 7 months ago Marcos Scofield 11 -
1
votes1
answer77
viewsC# - Collections - Enigma Exercise
Hello, I was making a college exercise list and I came across this exercise, where you have a part of the code and it asks you to find out what code structure it belongs to. In my view, this seems…
-
1
votes1
answer114
viewsDate validation
I’m doing a function of ExcelToEntityList, i.e., import Excel data into a list, but need to validate start and end dates. I’m doing it right? The function: public…
-
1
votes1
answer475
viewsSend data from a partial view to a MVC controller
I want it to be rendered a partial view corresponding to the value of select option. Index.html @{ ViewBag.Title = "Index"; } <h2>Contato</h2> <form class="form-horizontal">…
-
1
votes0
answers26
viewsReading and Xml Data Recovery
I have the following question... I am reading an Xml, and to get the values of the nodes I use ... public class Produto { [XmlElement("PRODUTO")] public string produto; } I would like a way to…
-
1
votes3
answers684
viewsHow to correctly scroll through all items in a checkedListBox C#?
I have a checkedListBox in a form tabControl. In the checkedlListBox there are several items that can be selected. When the user clicks on the button below the checkedListBox, a loop is launched…
c#asked 7 years, 9 months ago Wevelly Felipe 69 -
1
votes0
answers365
viewsC# client response Error 502: Bad Gateway - how to resolve?
using (var httpClient = new HttpClient()) { var request = new HttpRequestMessage(); string pathApi =…
-
1
votes1
answer183
viewsHow to create transparent and tangible component - Windows Form C#
I’m looking to create a Panel who will always have the property BringToFront, capable of being fully transparent to the point where it shows components behind it and still be possible to click on…
-
1
votes1
answer96
viewsReadline does not ask for data typing
static void Main(string[] args) { Console.WriteLine("ESCOLHA UMA OPÇÃO"); Console.WriteLine("-----------------"); Console.WriteLine("1-Encriptar"); Console.WriteLine("2-Decriptar");…
-
1
votes2
answers107
viewsHow to make a list comparator
I wanted to know how to make a list comparator in C# or bat, to identify only the different items between them
-
1
votes1
answer430
viewsSpend Tempdata
Good afternoon guys I’m having the following problem, I need to pass a variable to another controller and I’m trying to do this by Tempdata, follow the code: var user = User.Identity.GetUserId();…