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
votes1
answer90
viewsAngular post for ASP.MVC
I need to do a POST after a button click, so that this POST activates a method in a MVC controller, was testing as follows: [HttpPost] public void GerarPDF() { string teste = "teste"; } The name of…
-
0
votes1
answer2004
viewsCall Action via javascript
Good afternoon, I need help with a problem until simple, but it’s knocking me down. I need to call a controller method and pass two parameters to it, I did something, but it’s not working, someone…
-
0
votes1
answer159
viewsMake a select in the database and prohibit the insertion of repeated C# SQL Server data
I am new to C# and SQL Server, I need help to build something that for you is simple for sure. In my database has id, name and CPF. The Key is the ID and it goes automatically, but I also didn’t…
-
0
votes1
answer215
viewsClick() problem in an input with Selenium
I’m developing an automation that makes a Choose file in an input, but when I click on the element: driver.FindFirstElement(By.Id("chooseFile")).Click(); and every time the error returns to me:…
-
0
votes1
answer34
viewsC# code for Searchbar
I am trying to create a Searchbar in my code. It is only to understand the structure and syntax of the commands. After following some tutorials, I arrived at the following structure (attached). The…
-
0
votes0
answers86
viewsDelete duplicated postgresql lines
My code automatically inserts data into a database, making the BD too large and sometimes with repeated information. For this, I want to use the Slowly Changing Dimension (SCD) method so that: - A…
-
0
votes1
answer4366
viewsThe web server is configured not to list the contents of this directory
My project ran smoothly, when I needed to divide them into Areas. Then all my old controller (which ran perfectly) was migrated to a certain Area. The areas have been mapped and even updated…
-
0
votes1
answer40
viewsDoubt Entity Framework Core
I’m learning to program using EF, I’m doing from BD First, I have a BD from another project, and I would like to create a solution based on this comic, I decided to leave very quietly, starting with…
-
0
votes2
answers50
viewsUWP - Softwarebitmap for Stream
Eai personal, I’m using MediaFrameReader to capture the frames of a USB camera in a UWP application, the event return FrameArrived returns me an object of type Softwarebitmap, having this frame I…
-
0
votes2
answers428
viewsThe type must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method 'Dbset<Tentity>'
I am trying to set up an Enum in ENTITY FRAMEWORK. But I am not succeeding. My Context is like this: public class MoradaWebContext : DbContext { public DbSet<MeuEnum> Status { get; set; } }…
-
0
votes1
answer49
viewsInsert with Postgresql datatime and c#
I would like to ask a question, because the first date does not work? Cmd.Parameters.Addwithvalue("@dtUltAccess", "2017-01-01 01:01:01+09"); Error that returns: Error inserting user - Error: 42804:…
-
0
votes2
answers306
viewsSplit String Html
I have an HTML with the following code: <div class="page"> ...Conteúdo1 </div> <div class="page"> ...Conteúdo2 </div> <div class="page"> ...Conteúdo3 </div> the…
-
0
votes1
answer523
viewsInsert data into a table with Foreign key in the ID
I will try to be as objective as possible so not many codes will put (because the original is really too big). I am making a progress of simple registration that has: - 1 datagridview to select the…
-
0
votes1
answer32
viewsJoin in four tables using LAMBDA
I’ve been banging my head for two days to join with LAMBDA on these tables. I am creating a SESSION for my user in ASP.NET Core, before passing my object to JSON, I need to JOIN these tables.…
-
0
votes0
answers61
viewsRedirect after login to Xamarin Forms
I am creating an APP with Xamarin Forms, and after logging in with the login and password I receive the API data, I see that the login was successfully executed because I use the console.write to…
-
0
votes1
answer430
viewsError generating Controller MVC 5
Good morning colleagues, I am trying to generate a controller on MVC 5 with VS 2019 and am taking the following error message. Someone could help me with this problem? Error executing selected code…
-
0
votes0
answers23
viewsReceiving null parameters Httppatch Odata V4
Salve Foks, I’m having trouble passing values to the controller using the verb Httppath controller: [EnableQuery] [HttpPatch] public async Task<Document> Patch( [FromODataUri] int key1,…
-
0
votes1
answer28
viewsCompiling file . il (Intermediate Language) with admin permission
I’ve been doing a lot of research on how to insert certain parameters into an already created executable. And I arrived in that post of the Stack But the program initially has administrator…
-
0
votes3
answers300
viewsHow should I deal with mistakes?
Read a vector A with 12 elements. The vector must accept only the input of values that are divisible by 2 or 3. The input of values in the vector must be validated by the program and not by the…
-
0
votes1
answer213
viewsKeeping variable values in a class
I am creating a UWP application that will need to communicate with multiple modules (Rduino) by RS485. At this time and for testing I created a small application that communicates with any of these…
c#asked 7 years, 8 months ago Nuno Santos 9 -
0
votes1
answer79
viewsThis operation would create an incorrectly structured document. Xdocument
I’m trying to create an XML, but I’m not getting it. I want it to have this format: <item> <linktext></linktext> <etc..></etc...> </item> I can add one item, but…
-
0
votes2
answers177
viewsRun an SQL script in transaction without it blocking other scripts accessing the same table
Can anyone tell me if there is a way I can execute an SQL Server script in transaction without it blocking other scripts that try to access the same table? I created a program in c# that accesses my…
-
0
votes1
answer312
viewsHow can I stop Settimeout on C#
Hello, How can I stop the execution of Setimeout created in javascript only in C#? I Gero several PDF through this method. Below is the script: function geracao(formulario) {…
-
0
votes0
answers89
viewsDetermine the character’s flying time in Unity
I need him to execute the command to fly for a certain period. Example: The character has a jetpack, if you press the "space" key twice it will activate the flight code, only the astronaut only you…
-
0
votes2
answers1230
viewsHTML inside a Stringbuilder
I have an HTML where I’m formatting it inside a StringBuilder, where there are "quotes" I am passing a bar, but it is not opening the correct HTML. public string CorpoPaginaHtml() { StringBuilder…
-
0
votes1
answer101
viewsDoubt to make integration between web systems, using Httpwebrequest- Language c#
I’m building a C# web application using VS 2010. In this application I need to exchange information between the company website and an external website. Except that this site has no component for…
-
0
votes1
answer770
viewsCode error: The server committed a protocol breach. Section=Responsestatusline
When I run this line of code to access a URL I get the message. The server committed a protocol violation. Section=Responsestatusline. Does anyone have any idea what it might be? using (WebClient wc…
-
0
votes0
answers39
viewsC# - get JSESSIONID site ftp error 401
I can’t get JSESSIONID to download a file from an ftp. I need it because if I put JSESSIONID fixed the file low, otherwise it gives error 401 unauthorized. However this id changes. WebRequest…
-
0
votes1
answer167
viewsHow to group records by month and year within a list of objects? ASP NET CORE
I am trying to group the objects of a list by month or year, before returning the same. I am trying this way and I did not succeed. foreach (var item in passList) { pass_obj = new Pass_returnDTO();…
-
0
votes1
answer117
viewsProblems with the DAO
My DAL class launched the Typeinitializationexception exception. How to correct? Follows the code public partial class FrmConvenio : Form { ConvenioDAO convenioDAO = new ConvenioDAO(); // Lança…
-
0
votes0
answers34
viewsWhy use Asp.net core DI Container in conjunction with Onconfiguring the Entity Framework?
In many projects I realize that people tend to pass the Connection string both by dependency injection and optionsBuilder in the overlay of the Onconfiguring method.... What’s the point of using…
-
0
votes0
answers175
viewsDependency injection of two or more classes implementing the same interface
The entire architecture of my system is based on addiction injection, where in my configureServices I configure the injections as follows services Addscoped(); However the need arose for me to have…
-
0
votes1
answer177
viewsHow to make a Binding data in a Listview in Xamarin.Android?
I’m trying to do fills a listview with the data from a table, but so far I didn’t understand how to make the Binding date on it. XML; <?xml version="1.0" encoding="utf-8"?> <RelativeLayout…
-
0
votes1
answer177
viewsHow to pass the name of a wpf window as parameter
I use a userControl customized to show a Data Grid and when I double-click some line, I call a registration window, which is waiting to send the ID of the line selected as parameter, wanted to…
-
0
votes1
answer86
viewsDoubt Verb GET Webapi
Currently I have some compositions in my model that make relationship with other tables of my bank. When I went to assemble the get to bring me all the related data, I had several problems and…
-
0
votes2
answers441
viewsHow to disable double-click the header of a Datagrid?
Double-click method on the grid: private void grid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed && //Verifica clique com o esquerdo…
-
0
votes1
answer1250
viewsCtedistribuicaodfe - Problems when consulting webservice
I’m trying to consult the webservice of Sephaz. "https://www1.cte.fazenda.gov.br/CTeDistribuicaoDFe/CTeDistribuicaoDFe.asmx" I’m getting the error below: "403 Forbidden - Access Denied". The message…
-
0
votes0
answers296
viewsBlock Datagridview Changes
I’m creating a C# order screen with Windows Forms in which the user fills in the order item data and then clicks on an "Add" button, which instantiates a Pedidoitem object, adds it to a list and…
-
0
votes1
answer598
viewsMVC architecture - Windows Forms
How to implement the MVC standard using Windows Forms? I would like to understand better how to separate the Views, Controllers and Models following this development model.
-
0
votes1
answer129
viewsChange name and surname in a string
I work with an API that returns the last name to me first after the name and I need the reverse as the name reads ( in my case is a Book Author ), the return I have is ( Ex.: Bragança, Luiz Philippe…
-
0
votes1
answer143
viewsError: a property or an indexer that cannot be passed as an out or ref parameter
I’m having second thoughts about CS0206 Error Maybe a property or an indexer cannot be passed as an out or ref parameter on line 39 and 41 of my code, how do you solve this? 35| produtos[i] = new…
-
0
votes0
answers52
viewsWhat is Ihtmldocument2?
When it’s used, how it’s used, I can’t find anything to explain it to me? Code example: WebBrowser wb = new WebBrowser(); wb.Navigate(new Uri(location, UriKind.Absolute)); IHTMLDocument2 myDoc = new…
-
0
votes1
answer92
viewsUser fields
I’m developing a project using the V9 spring engines. For this project I need certain user fields. I know how to create them through the Administrator, but what I want is for them to be created…
c#asked 5 years, 1 month ago Pedro Amaro 3 -
0
votes2
answers263
viewsV9 Primavera - C# error in attribute "Comercial.Vendas.Davaloratributo"
Good afternoon to all, And thanks for your attention, I created a C# code to transform documents. I’m making a mistake: Microsoft.CSharp.Runtimebinder.Runtimebinderexception Hresult=0x80131500…
c#asked 5 years, 1 month ago Miguel Neto 11 -
0
votes1
answer203
viewsApply transition effect when changing the source of an Image control
I have a button to which is associated an image loaded from a Resourcedictionary. In XAML I carry them like this: <Button x:Name="selecao" Grid.Row="1" Grid.Column="2" Margin="10"…
-
0
votes1
answer73
viewsHow to access in Viewmodel, a Listview q is in a View?
So I have a page called Filmeview on it I have: <ListView BackgroundColor="WhiteSmoke" SeparatorColor="Blue" x:Name="listaFilme"> and I have a Viewmodel class: FilmeService filmeService = new…
-
0
votes1
answer48
viewsRemove characters 0 to left of a string c#
I came across a situation, I need to recover the user code that comes for example like this: '000063'. But my need was to take only the value of '63', use the . Trimstart would be a good option?…
c#asked 5 years ago PedroBelino 176 -
0
votes1
answer147
viewsHow to compress files into multiple files with specific sizes?
I have several files in one folder, these files are already . zip files, . 7zip, . rar... To facilitate the work of handling these files, I wanted to divide them into smaller files using c#. Is…
c#asked 5 years ago Bruno Warmling 1,540 -
0
votes1
answer63
viewsPicking up content from a textbox from another frame
Guys I need a little help, I have an app that I need to pick up the contents of a textbox in another form to put in a homebody. private void PDVForm_Load(object sender, EventArgs e) { var Operador =…
-
0
votes1
answer55
viewsCatch all words between 2 characters
Text: var texto = "if(true) { {{palavra1}} + {{palavra2}}; }" The only characters I know will ever exist are {{ and }}. I did so, but this way I only get the first word: Regex r = new…