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
answers25
viewsConvert a String to Ienumerable<Selectlistitem> in ASP.NET
Speak, guys, I’m new in the area of ASP.NET and studying Identity I came across a typo error when performing a new user registration. The project was done with the authenticity of the VS. I did the…
-
1
votes1
answer46
viewsAuto increment skipping values
I am developing a code initially registration and login, everything ok. I added a Unique Constraint to the database columns that I don’t want you to repeat and it worked fine. However, I would like…
-
1
votes0
answers40
viewsSwagger does not display methods containing array parameters
I created a WebApiwith basic methods intended to use the Swagger. I noticed that methods that have simple parameters like the one illustrated in the code below are displayed by Swagger but methods…
-
1
votes1
answer21
viewsCapture key pressed using name instead of numbers
I’m trying to capture the value of each key in C# by the Keydown event, works perfectly, but the value of each is returned by numbers, for example when pressing TAB is captured 9. There would be a…
c#asked 3 years, 8 months ago Higor Matheus 11 -
1
votes1
answer44
viewsSelenium Wait function does not capture loading element that appears quickly on the screen
I have the following Widget in HTML <div class="atl-container"> <div class="ui_active_loader"> ::before ::after </div> </div> Shown in the following image In the official…
-
1
votes1
answer104
viewsURI 1259 - Increasing and Decreasing Odd Pairs
I’m solving that URI Online Judge challenge. But my code has had the answer "Time limit exceeded", and I don’t understand exactly why. Follows code below: using System; using System.Linq; namespace…
-
1
votes1
answer49
viewsDownload with Httpwebclient only works outside of Parallel.Foreach
I am developing a class for downloading C files#: Filedownloader. The problem is occurring in using it. I am trying to make simultaneous downloads, it is working normal when it is running outside…
c#asked 3 years, 8 months ago Lucas Pedro 297 -
1
votes1
answer38
viewsI cannot create an iterator class with Ienumerable<T>
I’m creating an iterator class - has support for foreach - implementing the interface IEnumerable<T> package System.Collections.Generic, as in the code below: public class MyList<T> :…
-
1
votes2
answers49
viewsC# How to get combobox value?
Hello, my friends! I am programming in C# and use Visual Studio 2019 to create an application in Forms. I have a combobox that I linked to a table using the Datasource property. When the user…
-
1
votes1
answer52
viewsDatabase-dependent validations using Flunt
We are using Flunt and we are in doubt how to make a notification from a validation that needs to go to the bank. We have made an implementation and would like to see how best to do this: For…
-
1
votes2
answers68
viewsAdd values inside XML tags with C#
I’m trying to create a C# script for a Plugin in Notepad++, where the goal is to add all the values inside the tags <ValorDesconto>, <ValorCancelamento> and <ValorTotalLiquido> of…
-
1
votes0
answers24
viewsI cannot instantiate an object from an Assets(Asset Bundle) package
using System.Collections; using System.Collections.Generic; using System.IO; using ModIO; using UnityEngine; public class ModScript : MonoBehaviour{ public string bundleName = "modbundle"; private…
-
1
votes1
answer30
viewsHow does the Dbcontext startup work in the Entity Framework Core?
How to initialize an object DbContext works? The ways I always see is by injection of dependency or using the using. What would happen if I initialized it as a normal object? (Follow an example…
-
1
votes1
answer38
viewsHow to use Async/Await Asp . Net Core correctly
I am using asynchronous requests in various parts of the project, but a doubt has arisen because I know that for a method to be asynchronous it is necessary the same being async and have a await.…
-
1
votes0
answers23
viewsBy inserting data generated in Behind code through the model without having to DISPLAY in the view, is it possible?
Look I’ll start by saying that I know what I’m trying to do is break a taboo of the MVVM standard, but it is not possible that there is no other way to do this, it is common to have q create new…
-
1
votes0
answers23
viewsPassing Datatable to a table-Valued Parameter in a stored SQL file does not work
I’m creating a revenue website. On my Masterpage (I am working on ASP.net), I have a search icon and when the user clicks on that icon, I will read three checkboxlists and pass the selected values…
-
1
votes1
answer40
viewsReturn Iqueryable in the method
I am using Identityframework in my project and need to create a method that returns a Iqueryable Follows below class structure: namespace MeuProjeto.Controllers public class UsuariosController :…
-
1
votes1
answer25
viewsCreate click event for multiple C#buttons
I make a class to generate buttons like this: public Button GerarBotao(string Text, string Name) { Button button = new Button(); button.Text = Text; button.Name = Name; button.Dock = DockStyle.Top;…
-
1
votes1
answer76
viewsGenerate csv file in Excel standard with Csvhelper C#
I created a project to generate a . csv file (which will be used in Excel). So far it is working normally and is being generated in the format "Excel . csv", but the problem is that when opening the…
-
1
votes0
answers18
viewsError connecting to Entity Framework in an existing BD
I created an application that uses Entity Framework 6X and Code First mode by Fluent API, Map Classes, using classes from my model , and creating the context class. When I try to connect to see if…
-
1
votes1
answer38
viewsSelect String attribute using Split and LINQ?
I have the following string "1,2,3,4,5,6,7,8,9,10," that I want to make a Split in a Select to search in the database if the number 9 is inserted in a field that receives strings of numbers. I want…
-
1
votes0
answers25
viewsSimultaneous rescue of related entities
Good afternoon. I am having a difficulty that I believe is something very simple but as I am new in the area I am facing an absurd problem. I have 2 entities (at the example level), one called…
-
1
votes1
answer28
viewsWhy do I still have access to the current state of the object in this case? [EXAMPLE C#]
A very basic doubt, but it’s bugging my head. I have the following code snippet: A class that receives a list as a parameter in the constructor: public class MinhaClasse { IList<int> Items;…
-
1
votes1
answer28
viewsInsert a select in c#
Good night! Personal, I have a select working normally and displaying the result in a datagridviewer all straight though, I need to take the result of this query that is done in the mysql database…
-
1
votes1
answer30
viewsHow to run a method until the return is true(true) ? Windows Forms C#
I have a condition where the main FORM only opens when the charger is connected. How do I keep updating the battery percentage in the main FORM ? How do I keep monitoring if he removes the charger…
-
1
votes1
answer35
viewsHow to make an internal calculation in Textbox?
I need to calculate a value entered in Textbox and this value I enter is multiplied by 9,81. So all the numbers I insert in this Textbox will be multiplied by 9,81 and you will have to show me the…
-
0
votes1
answer149
viewsHow can I create a control that has subcontrols without explicitly adding a template?
I want to create a control exactly like a Panel. <asp:Panel runat="server"> Conteúdo <div>Content</div> </asp:Panel> I want to be able to put controls inside it without…
-
0
votes1
answer887
viewsHow can I allow insertion directly into a Datagridview?
I am setting the DataSource of a DataGridView with a List<T>. I enabled by designer "enable addition". But there is not appearing that line with asterisk for adding new elements. My code is…
-
0
votes2
answers7874
viewsHow to pass lines from one Datagridview to another?
I wish to pass the selected lines of a datagrid for another, for example, I select lines, click on a button, and they pass to one another. Is to make an add - remove items. I have two datagrids, one…
-
0
votes1
answer218
viewsHow to change settings for a Binding Source?
How do I run an application that is linking (Binding) to a local database to use Binding on any machine.
-
0
votes2
answers67
viewsHow to convert Sender to a Form?
In my program, I need the following routine to work: private void FuncaoTal() { frmSelecao.FormClosing += atualizarEvento; SplitContMenu.Panel2.Controls.Clear();…
-
0
votes3
answers403
viewsLog reading to infer counter
I have a template called Request and this template has a column called Number. This number has the following structure: YEAR + COUNTER. It just so happens that every time I create a new request I…
-
0
votes1
answer257
viewsRenderaction does not consider my validations in ASP.NET models
Renderaction stopped considering the fields marked as [Required] on my models. Example of one of the models: private uint IdNews { get; set; } [Required(ErrorMessage = "Defina o título.")] public…
-
0
votes1
answer2060
viewsOCI-22053: overflow error - C#
I am developing a web application in MVC with C#. I made a method that makes a select in my bank oracle and with the value returned I fill a DataTable. But it returns an error the moment I run…
-
0
votes2
answers675
viewsHow to enable the "Add Controller" option in the menu?
Recently the option of mine Adicionar controller is off the menu. I’m using Visual Studio 2013, and the project is ASP NET MVC, version 5.1. How to fix this problem?…
c# asp.net-mvc visual-studio-2013 asp.net-mvc-5asked 10 years, 9 months ago Ivan Ricardo Lopes 1,376 -
0
votes1
answer159
viewsSum of a Sqldatasource result
I am developing a reporting system to control calls and need to take the result of a query and make a sum that brings me the total number of calls per sector of a certain number. I’m using Stored…
-
0
votes2
answers2219
viewsHow to upload multiple images with just 1 click?
I’m studying uploading images and files, and I can upload 1 image, and show it on the screen, but I’m interested in uploading multiple images with only one button, just like this web application…
-
0
votes1
answer49
viewsHow to use macros in VS2008?
I only know how to use macros in Netbeans according to the manual https://netbeans.org/kb/docs/ide/macro-keywords_pt_BR.html. But I wanted to know how do I use macros in vs2008? I want to set a…
-
0
votes1
answer210
viewsSQL CE Insert Error in Database
I am creating an application for a PDA, when I try to insert data in the database I always find this error. There was an error Parsing the query. [ Token line number = 1,Token line offset =…
-
0
votes3
answers3981
viewsDeclare variable within my cshtml
I have this code in my cshtml file <div class="grid_19 box-resultado"> @{ string nm, dia, mes, ano, sexo, numpassaporte, diavalidade, mesvalidade, anovalidade, paisemissao, dados = ""; .......…
-
0
votes1
answer267
viewsGenerating fields by ASP.NET code
I’m making a web application with ASP.NET and C#. In this application I can register several items of the same type, so it has a text field and a button on the side to create new text boxes. I’ve…
-
0
votes2
answers399
viewsListview inside Listview or Repeat inside Repeat?
I need to display some products divided by category, the categories are created by the user and both come from the database TB_CATEGORIA, TB_PRODUTOS, has how to do with Listview, Repeat? For…
-
0
votes1
answer369
viewsFind HTML inside an iframe
I’m having trouble getting the data from a table on the Bovespa website, because they are inside a iframe and I’m not getting it from Webbrowser, I am using windowsForm.…
-
0
votes3
answers3813
viewsReports in C# MVC
How do I report to c# Asp.net-mvc-4? I use a third-party component or make an HTML page myself? What you use in everyday life? I ask, because I need to print reports that follow a government…
-
0
votes2
answers1057
viewsrun/call a page remotely
I want to run a remote page, I don’t care what this page does, I just need to run it and wait for it to load 100% to run another, and so on. I don’t need to recover any information from that page.…
-
0
votes2
answers200
viewsHow do I get Bitrate Mode from a C#MP3?
The audio I have is CBR (Constant bit rate), VBR (Variable bit rate) or AVR (Average bit rate), I tried using ffmpeg, only it does not return me the bitrate mode information?
-
0
votes1
answer104
viewsResources on app_globalresource
I have a class library where I added a file resx, someone knows how I can in Runtime put this resx in app_globalresource to make it available in all my app web mvc?…
-
0
votes2
answers1051
viewsSQL QUERY get Average one month of a relative day of the week
I need a query that returns me to the average of a relative month, and a day of the week. For example: I need to know the components relating to the month of February, the day of the week Monday. It…
-
0
votes1
answer351
viewsQuery Dynamic Linq
I need to create a dynamic query, where the DayOfWeek.Monday is dynamic, as I can define it? DataClassesPDataContext pe = new DataClassesPDataContext(); var qry = from p in pe.R join q in pe.V on…
-
0
votes2
answers1070
views