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
votes0
answers25
viewsProgram does not appear in the toolbar on startup
Hello, I have the following error: when opening the program, its icon does not appear on Taskbar, and before that did not happen. It happened now! Here’s the image, when opening the program (Look at…
c#asked 6 years, 6 months ago Lucas Bittencourt 959 -
0
votes1
answer32
viewsSQL error in casting int to string
I have a method where I need to return the ID (integer) of a particular record whose name I pass as parameter, but Visual Studio points out the following error : Undefined object reference for an…
-
0
votes1
answer342
viewsHow to identify if the access is internal or external?
I have an application in Asp.mvc that has 3 (three) types of access, 2 internal and 1 external. Internal access is done by LDAP and external access by a user table. No entanto o usuário externo…
javascript c# asp.net-mvc-5 ip access-controlasked 6 years, 6 months ago Danielle Arruda torres 1,191 -
0
votes3
answers166
viewsHow do I stop a running program?
I created a program that compresses files using 7z and as there are several files within a loop and the program should compress 1 file at a time, I used WaitForExit() The program works perfectly,…
c#asked 6 years, 6 months ago Fabyo Guimaraes 58 -
0
votes0
answers414
viewsHow to convert a json return to a C# object display the result on the screen
I’m having a little trouble reading a JSON and convert to an Object and display the data on the screen using C#, I’m using the lib Newtonsoft and would like to know how to check if the data type is…
-
0
votes0
answers370
viewsMVC Upload Image and send the database
Good evening I’m making an online shop for a discipline and I was wondering if someone could help me create the image upload to the Database. The purpose is to add in the admin page and appear in…
-
0
votes0
answers203
viewsAsynchronous handler completed while asynchronous operation was pending - C#
Hello, I have some questions regarding the code below. The return code the following error [Invalidoperationexception]: Asynchronous module or manipulator completed while asynchronous operation was…
-
0
votes2
answers997
viewsHow to insert new object in json file
Follows json file: [{"Id":0,"Nome":"","Endereco":""}] Follows the class: public class JsonResult { public int Id { get; set; } public string Nome { get; set; } public string Endereco { get; set; } }…
-
0
votes1
answer92
viewsDecode javascript-encoded string in c#
Hey, here’s the deal. On the site that I’m building, I write information in the database, this information is a json, to be able to send this data to the database, I code it by javascript like this:…
-
0
votes0
answers27
viewsBring related data in a table
I need to bring the sessions of a certain film, but in case there is more than one session in the same cinema, bring only one data and the two times side by side. Does anyone have any way? It’s my…
-
0
votes2
answers101
viewsDo you doubt about " insertion" of variables in the input command in C#?
Well, my doubt is this, in C# I can use my "constants" be it of any type in my output command, everything normal. However, if I use a "variable" of the type int or double and put them in the input…
c#asked 6 years, 6 months ago Antonio Lima 25 -
0
votes1
answer95
viewsProblem when cancelling a process
I asked a question earlier to cancel the process of compressing files. I have 2 problems with this code, the program has the function of compressing files in pairs separately getting 2 files in each…
-
0
votes1
answer67
viewstouch screen c# winforms
I developed this application that visualizes information contained on a website through windows Forms and with the webbrowser component. The application works with the mouse perfectly. When I run on…
-
0
votes1
answer83
viewsLoad a window only once after reloading the site in Asp.net C#
Having this window when accessing a website for the first time, how do I only appear once even after reloading the website or the user goes back to the home page and does not reappear this?…
-
0
votes2
answers151
viewsHow is the Generics syntax in C# compared to Java?
I am a Java developer studying C# and came across the following difference between the two languages: https://nerdparadise.com/programming/csharpforjavadevs Generics Generics are Much Less fiddly in…
-
0
votes1
answer77
viewsSqlite in memory with Dapper generates non-existent table error
I have the following code for table creation: string query = @"CREATE TABLE GVP_USERS_TAGS( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT, DATEINS datetime NOT NULL DEFAULT (DATETIME('now')), NAME…
-
0
votes1
answer144
viewsIntegration tests using sqlite memory two api calls
I’m having trouble making an Insert call (and creating the database) after query occurs that the database is in memory the problem is that ended called the database dies. It would be interesting if…
-
0
votes1
answer195
viewsImport XML File Data to Array
Good morning, I have the following XML code. <?xml version="1.0" encoding="utf-8"?> <Regras> <Regra Id="1" ExtensaoArquivo=".RET" PastaOrigem="C:\Nova pasta\" PastaDestino="C:\Nova…
-
0
votes1
answer38
viewsError of log. Append
I have an excel sheet with fields referring to dates, however, if I do not fill these fields, I should display message log for this user, but if I leave blank, the log is not shown. I put breakpoint…
-
0
votes1
answer86
viewsIsolate and update only one Div
It is possible to 'isolate' a Div and update only her ? Example: I have the option to change the profile photo on the user, where as soon as it is changed from the one Reload on the page in order to…
-
0
votes1
answer668
viewsIs there any way to force the line break inside the <table> tag?
I have a Select in bank that returns me a number of records, in the case of tax notes, each note of these has N items, and I would like to make a subtable that when it is clicked, list correctly.…
-
0
votes2
answers359
viewsGeneric Method of a Generic Class C# for similar classes
I have some classes that will use a record method. I created a CRUD (Generic) class where would have a method to write, but I need this method to receive as parameter the classes. There is some way…
-
0
votes1
answer217
viewsGet or return a variable to the angular
I have a method where I do a certain validation and depending on the scenario, I need to return only an alert and continue with the request or a possible Badrequest also returning a message. I…
-
0
votes0
answers348
viewsConsume Webservice Nfe GO C# Error 495 Unknown Code
I am getting the following error while trying to consume Nfe GO Webservice Error 90 - Nfestatusservico. The remote server returned an unexpected response: (495) Unknown Code as I am creating a dll I…
-
0
votes1
answer442
viewsConnection Sql Server Database . MDF does not work C#
My error application when I try to run on another machine, only on this machine I have nothing sql server installed, what I need to run my application on any pc? Follow the error:…
-
0
votes0
answers35
viewsHttppostedfilebase.ContentLength.Tostring() returns "0"
Follows code: HttpFileCollectionBase files; I get the file size like this: var tamanho = files[0].ContentLength; //tamanho é 1250 So far works normal when I want to convert to string: var tamanho =…
c#asked 6 years, 6 months ago Matheus Miranda 5,375 -
0
votes0
answers99
viewsProblem updating object properties with data Binding
I’m trying to update the properties of an object every time a character is added/removed from the textboxes but I’m not getting... I read several topics about databinding and everything seems to be…
-
0
votes0
answers788
viewsLocal database . MDF C# Visual Studio 2017 (CONNECTION)
I am developing a windows application using visual studio 2017, but I came across a problem, on my machine that I am doing the project everything runs right, on the other machine that I do the tests…
-
0
votes2
answers250
viewsHow to sort and list only 5 items from a list?
You see, I am developing the Dashboard of a web system, in one of the filters I should list the 5 main customers and sort them by higher value of the sums of total of issued bills. I’m already able…
-
0
votes3
answers1171
viewsDropdown Selenium C#
I am trying to select a dropdown with Selenium C#, but as we can see in the HTML below there is no "ID" or "Name", below the code of how I am doing, could help me? <select…
-
0
votes2
answers3609
views"The process cannot access the file because it is being used by another process"
I have a class that retrieves database data and stores it in a D.Reader, and write each record in a text file, in this method: public void Escreve_Arquivos_Txt() { string folder =…
-
0
votes2
answers568
viewsDatabase connection error . MDF C# Visual Studio
App.Config <connectionStrings> <add name="conn" connectionString="Data Source=.\SQLExpress;AttachDbFilename=C:\Sistema\Sistema.mdf;Integrated Security=True"…
-
0
votes1
answer413
viewsC# CRUD - Insert Error (Cannot add or update a Child Row: a Foreign key Constraint fails...)
Good morning, I had managed to do everything right up to this error by inserting something into the database. localhost/phpmyadmin - xampp. It’s something with the id_user but I don’t know what it…
-
0
votes1
answer727
viewsHow to do for when click on the button perform action every 1 second
I’m using Cefsharp and I wanted when clicked on the button runs the javascript every 1 second and in the background too, and only stop if you hit the off button. I tried for the backgroundworker but…
-
0
votes1
answer614
viewsHow to close the program by pressing the button
How can I close the program by pressing the ESC key? Even if I have a Messagebox or something else preventing it? I tried this way but I couldn’t: private void Form_KeyDown(object sender,…
-
0
votes0
answers29
viewsError in Function Generic for Procedure Return
I am trying to make a Generic method for return of Procedure, but when picking up Datarow to make a Cast generates the following error: Unable to cast Object of type 'System.Data.Datarow' to type…
-
0
votes1
answer156
viewsHow do this FOR (in C#) list only the first five items?
I have an orderly list, which I need to display only the first 5 items, not all bank records, so I’m not getting it. Here’s my code as is: public class DashboardController : Controller { private…
-
0
votes1
answer36
viewsC# - High memory consumption when calling method
I am working with a Main Form and it has several Panels. In one of them, the "Geral panel" I use to call the instances of new forms and show in it using the following code of the Formcall class:…
-
0
votes1
answer51
viewsHow to have the option to connect to more than one database in my C# Visual Studio app via the.config app
I have a C# application I made in Visual Studio. This application connects to an Sql Server database. I would like to put on my login an option in list form to choose another bank if I have more…
-
0
votes2
answers61
viewsHow to set id= with ' instead of "
How can I set id= with ' instead of " because if I try to run the script on chromeBrowser.Executescriptasync with the error id=""it, how can I do this? html/javascript code var x = '<label…
-
0
votes1
answer161
viewsError connecting to database using Entity Framework
I am creating a WPF application, and decided to use the Entityframework to perform operations in my bank. I created a data model from an existing database in my Mysql Workbench, and the process was…
-
0
votes1
answer53
viewsSave form Razor
How can I make my form not to sumbit the same form several times. I’m having this problem because some users are clicking save several times, not waiting for the screen update, so it is saving…
-
0
votes0
answers38
viewsWhy does my Hash Md5 encryption not work? I am using Asp net mvc and Sqlserver
public static class CriptoHelper { public static string HashMD5(string val) { var bytes = Encoding.ASCII.GetBytes(val); var md5 = MD5.Create(); var hash = md5.ComputeHash(bytes); var ret =…
c#asked 6 years, 5 months ago user115154 -
0
votes0
answers192
viewsQuestions about Picker in Xamarin.Forms
I am creating a mobile application where the user can register x ingredients and later can register products choosing which of the registered ingredients such product uses. In this perspective:…
-
0
votes1
answer33
viewsChange a property value after aspnet click
I got all the CRUD done, but I wish when I click the button "approve" in my View where you are listing Registered Data, change only the property Situation. I put by default, so she always gets…
-
0
votes1
answer17
viewsGenerate a single page with all records
I have a query that returns a list with objects. From this list, I go through each position, define some object parameters and return to a view. What I’m trying to do is: Scroll through all…
-
0
votes2
answers173
viewsC# - Filter Include - Context
In the method below, I return some records of my entity Consultintramexrules, where it has relation with the . INCLUDE ("Emails and Parameters"). Aware that EF does not allow filtering in . INCLUDE,…
-
0
votes1
answer44
viewsc# Change control properties of another file
i have 2 Forms(the login and the program) by the login of the person i qro that one of the 2 panels (within the program has 2 panels for each type of login: the Adm and work) go ahead but Login.CS…
-
0
votes0
answers55
views"Undefined object reference for an object instance."
When I instate a class this error occurs. Classe : AnttLogDTO using System; namespace NewsGPS.Contracts.DTO { public class AnttLogDTO { public string jsonEnviado { get; set; } public string…
-
0
votes1
answer186
viewsRoute problem with MVC 5 C#
I’ve already researched it, I’ve spent two hours burning the dog but I couldn’t find a solution. Has anyone ever had that problem? I have the following link:…