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
-
4
votes1
answer526
viewsSearch in a form and bring the return to the form you called
in my college project I am doing the product registration ta all right my problem is to load the supplier in the product registration. I created a form frmCartiroProduct and a form…
c#asked 9 years, 4 months ago Denilson Carlos 201 -
4
votes2
answers55
viewsGet information stored in an "attribute"
In the ORM I use, classes are mapped using Attributes. I need to recover the value stored in them. Ex.: [Table("CADASTRO_CLIENTE")] public class Cliente { [Property("Id")] public int Id { get; set;…
-
4
votes2
answers1276
viewsHow to lock an executable file and prevent it from opening on Windows?
I would like to create a particular program where I can block programs from running on Windows, I know that Windows itself provides something basic about this, but I wanted to create my program,…
-
4
votes1
answer620
viewsMount a local package manager (Nuget)
Due to a huge problem that happens here in the company, such as package dependencies, so the company decided to create a NuGet private, which runs locally. The purpose of this is when anyone…
-
4
votes1
answer99
viewsDoubts with Arrays in C#
Good night, you guys. I am a beginner in programming and have two questions: When a double array is maintained in C#, each position of the array starts-without as null or zero? Is there a method…
-
4
votes2
answers989
viewsHow to install Sqlite to be part of a C#project?
I am creating a desktop application in C# of registration that will use database. Which database to use? I was advised to use the Sqlite, but I’m not quite sure how to use it. Which version of…
-
4
votes2
answers758
viewsCheck for installed components
In my project I have a built-in browser so that the user can access a particular site he needs. The browser works, only it has as requirements the C++ 2012 library and Flash. Is there any way to…
-
4
votes2
answers1770
viewsReferencing folders created in the project
After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if I would use in one controller, I would use as…
-
4
votes1
answer686
viewsTurn Stream into PDF to send with attachment in email
I am making a page to send email, and I need to turn a specific page into pdf to be attached to the email. The page I already managed to turn into Stream, now how can I do to turn it into pdf and…
-
4
votes1
answer119
viewsHow do MVC application authentication with Linux?
I have a project in ASP.Net MVC and I’m putting the authentication manually. Everything is going well, but I used as a reference a ready-made project that uses the Entityframework, but I want to use…
-
4
votes1
answer2448
viewsChanging Routes with Asp.Net MVC
I’m trying to change a route in my project, the control is like this: public class TagController : Controller { // GET: Tag private MYEntities db = new MYEntities (); [Route("tags")]…
-
4
votes3
answers4613
viewsCreate a Mask for Cpf using Xamarin
Hello, I would like to create a Cpf mask using edittext, but I did not succeed; I searched the net and found several examples in java, but I could not adapt to c#, someone could help me? Thanks in…
-
4
votes2
answers258
viewsGlobal Exception Handling with Web API 2
I’m willing to use the Global Error Handling with Webapi 2. I created a new project, within it I created the following class: Errologteste.Cs using System; using System.Collections.Generic; using…
-
4
votes0
answers377
viewsSignair - C# - Real-Time Response
I’m using C#, Asp . Net, SQL Server. I have the following question, I am creating a web and mobile application to communicate with a Webapi but I came across the problem of information and/ or data…
-
4
votes1
answer606
viewsPDF formatting
I would like to format the sizes of your cells and your text for PDF export. protected void ExportPDF() { int colCount = _gvConsultaRelatorio.Columns.Count - 1; PdfPTable table = new…
-
4
votes1
answer1952
viewsRead CSV file without needing to save it
I have following code: [HttpPost] public ActionResult importCSV(HttpPostedFileBase file) { if (file.ContentLength <= 0) { ViewBag.Message = "Nenhum arquivo foi enviado."; return View("index"); }…
-
4
votes1
answer2293
viewsMicrosoft.Speech.Recognation and System.Speech.Recognation Plataformnotsupportedexception
I’m having a problem with Microsoft.Speech.Recognition and also with the System.Speech.Recognation; Well, I was able to run the application to support the English language, which in the case is…
-
4
votes1
answer169
viewsAutomate DDD
There is a faster way to create a structure on Asp.net mvc using DDD (plugin or framework)? For example, whenever you create a new entity, you need to create many files in several projects and also…
-
4
votes1
answer715
viewsFile comparison
I need to compare files from different directories and show the differences. But I don’t want to list the name of the files, I just want you to make a comparison of the directories and show the…
-
4
votes1
answer5523
viewsProblems returning a large amount of data through WCF
Good Afternoon, I have a web service done in WCF, when I do a query in the bank and return a large amount of records it gives me the following error: An unhandled Exception of type…
-
4
votes1
answer955
viewsEdit field within a list in Asp.net MVC
Guys, I’m developing an application that manages Courses, and I’m trying to make a list where present on the screen the Courses, the Student Name and the countryside Approved, where it indicates…
-
4
votes3
answers171
viewsHow to simplify this comparison?
I often fall into the following situation : For example in c#: string variavel= "x"; boolean b = (variavel == "a" || variavel == "d" ||.....|| variavel== "y"); Is there any way to simplify something…
c#asked 8 years, 8 months ago John Diego 1,067 -
4
votes2
answers1180
viewsValidationsummary - Asp.Net MVC problems
I’m having problems with Validationsummary in my application that manages Courses, I have a screen where the student enrolls in a course and in case he tries to enroll in it course again should…
-
4
votes1
answer121
viewsHow to create an Event on a Webservice
I have a Webservice that has a method that records a new entry record and updates the list that contains those entries. Now I need the customer to sign up for a Webservice event so that whenever a…
-
4
votes1
answer1002
viewsConnect to SQL Server on remote server
I need to connect to an SQL Server service on a remote server via Sqlconnection, C#. Initially, it was not possible to find the server, but I solved this by modifying the hosts file of system32,…
-
4
votes2
answers2052
viewsUpdate page(View) automatically in Asp.Net MVC
Guys, in my application that manages Courses, i have a sign-up screen, where the student clicks on the button "enrollment" and enrolls in the course, and the amount of vacancies field is decreasing.…
-
4
votes1
answer1190
viewsUnity 5 Delay in animation
I just created animation to run and jump with Unity, but I have a problem when the player goes back to the initial state of Idleplayer, when I stop running or jump it continues for another second, I…
-
4
votes2
answers445
viewsUpdate Text linked to a Databinding
I have the following property linked to a label, where the value of this property appears in the text field. Like this: this.labelPedidosHoje.DataBindings.Add("Text", pedidosIntegrados,…
-
4
votes1
answer603
viewsStart application only if a url is working (Online)
I’m starting to try to learn a little in "Marra", and I wanted to know if there is any code to check if a specific URL is online, if it is the application has to start normally, if not, the…
-
4
votes1
answer186
viewsc#: using threads in a "windows Forms" project
In my application I have several "subprocesses". They all emit information in which they are displayed in the Form. I used System.Windows.Forms.Timer: Class x { public Timer timer {get; set;} public…
-
4
votes2
answers523
viewsHow to create progress bar for uploading file via Google Drive API
I am sending file to Google Drive by their API. The request.Upload(); is lingering with no return. How do I make progress? It can be with a for even without a graphical user interface. Shipping…
-
4
votes2
answers236
viewsDo Regex.Split on what is not between "..."
Which regular expression I use to get the comma character that is not inside the fields "...", example: line1, "line2", "hello,world", 215, X + Y ^ ^ ^ ^ I want to get only the nominees, I’m using…
-
4
votes1
answer493
viewsHow to mount SELECT in lambda C#?
I recently asked for help to assemble a SELECT to bring the price of products How to mount SELECT They gave me this solution that worked perfectly: SELECT P.PROCODIGO, P.PRONOME, H.HISPRECO FROM…
c# sql select entity-framework-6 lambda-expressionsasked 8 years, 7 months ago André Morais Martins 367 -
4
votes1
answer831
viewsAutomatic class generator
How do I take the BD(Oracle) entity and generate in my system a class that represents that entity? Ex: I have this entity Client ID int Primary key Name varchar(100) And now with the tool it already…
-
4
votes1
answer78
viewsHow to create a Bitmap from a Color[][]?
I had to transform a Bitmap into Color[][] to apply some algorithms and need to recreate the bitmap. There is an easy way to do this? To turn the bitmap into Color[][] I did what is below. There is…
c#asked 8 years, 7 months ago Felipe Deveza 166 -
4
votes1
answer1001
viewsEnd a process without closing the executable
I’m developing an integrated system with a TEF. Every time a credit card transaction is performed the TEF creates a file with a specified name in a specific directory, my application reads this file…
-
4
votes1
answer1794
viewsHow can I check if an object exists in the dictionary and return it
I am working on a solution in which I must enter on the same function with a given name of a Park. The parks are implemented in a list and each park has a name. It happens that I intend and already…
-
4
votes1
answer72
viewsMy delete button is giving error expects the Parameter
When I try to make a DELETE the following message is appearing: My code: private void BtnExcluir_Click(object sender, EventArgs e) { if (MessageBox.Show("Confirma a Exclusão desses Registros?",…
-
4
votes0
answers139
viewsHow to get the highlight color of Windows?
How I access the user-defined Windows 10 highlight color.…
-
4
votes1
answer459
viewsDoubt about FK, Visual Studio database
Hi, I created three tables in a database in Visual Studio, the first two (clientes and produtos) are normal tables with Primary key in column Nome. Then I created the table compras that would have…
-
4
votes2
answers1043
viewsASP.NET Identity and mapping Many to Many (Fluent API)
I recently created a Solution with the DDD architecture, putting ASP.NET Identity in a transverse layer (CrossCutting), I saw that many people use Identity this way and decided to try it. However, I…
-
4
votes1
answer2860
viewsWhen should I or should I not use the if without keys?
I usually use always with keys because until today I do not know how exactly is the function of if without keys and if Else can also be without keys. Is there any variation in behavior between…
-
4
votes1
answer94
viewsFile installation/copy system
How to use items SortedDictionary File.WriteAllBytes to start or complete a file and folder installation process for the computer. Ex: File list: void AlocarArquivos(){ var arquivo_e_pasta = new…
-
4
votes2
answers169
viewsHow to capture the Exception generated by a method whose access is not authorized by a particular user profile
How can I send the user a message that the operation he wants to do is not authorized? I have in my View a button that calls a Javascript function <button id="btninicio"…
-
4
votes2
answers525
viewsRemoving strings from html files
In my project I need to read the contents of an HTML file as said in that question of mine. What happens is I can scan the file, but there’s a comment I wanted to take out. The peculiarity is that…
-
4
votes1
answer220
viewsWhere to implement Facade in the MVC?
I’m developing a C# project using MVC, but the teacher wants all students' projects to have Facade, the doubt is as follows ! Where I implement Facade, Model, View or Controller ?
-
4
votes1
answer61
viewsPartial for separation of events and methods
I saw in a system a separation of methods in a partial and the events in another in UserControl and Window as the example below: "Pessoa.xaml.cs" public partial class Pessoa: UserControl {…
-
4
votes3
answers2971
viewsGenerate an xml in c#
I need to create an application, where the data will be saved in a local xml and then sent to a server using wcf. However I am with the following doubts what I do in the client and what I do in the…
-
4
votes1
answer682
viewsSend only object from the list that has changed to the controller
I own a view who lists all my customers. Each customer has 3 checkbox where the user selects them, and sends them to the controller - through the button (Submit) - the data to change. The method is…
-
4
votes1
answer193
viewsEntity Framework 6 tries to insert FK
I have a small application in C#, WPF and EF6. I’m using Code First, but I’m having a hard time creating a relationship. Look at my code, of the classes I want to relate: I’m editing for the final…