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
-
2
votes1
answer143
viewsDatagridview Filter(Rowfilter) is giving error
My code: private void txtVendaFiltro_TextChanged(object sender, EventArgs e) { (GridVendas.DataSource as DataTable).DefaultView.RowFilter = string.Format("id LIKE '%{0}%'", txtVendaFiltro.Text); }…
c#asked 8 years, 8 months ago Daniel Vasconcelos 49 -
2
votes1
answer205
viewsDoubts about using Contains with Regex in C#
I would like to use in a code in C# the method Contains , but instead of spending one string literal, ie a specific word, pass a pattern or a regular expression as parameter. For example: Instead of…
-
2
votes1
answer185
viewsDoubt Model Service DDD
I have a question about a project that follows the DDD architecture model. In a service model I need information that is the result of a method from another service, which is the correct way for me…
-
2
votes1
answer159
viewsOutput of a method or event - C# / WPF
I am using a return to be able to leave the event textEstado_Validate. The problem is that when he leaves this event, he enters the textEstado_KeyDown. How can I make sure he doesn’t enter any other…
-
2
votes2
answers1387
viewsList Folders and Subfolders of an FTP with C#
Would anyone know if it is possible, if yes, how to list all folders and subfolders of a FTP? Okay, here’s the idea. I’m listing all the Files and Directories in this FTP, but different from…
-
2
votes1
answer755
viewsChange the color of a line and take the selection of a Datagrid
I have a method where I can change the color of a line in my Datagrid. I followed through this link: Link The problem is being like taking out the selection from when it is painted. Type, go back to…
-
2
votes1
answer786
viewsMake Animated Screen Loading - Unity 5.1
I’m having problems to make a Loading Screen for my game, the game is a little big so it takes some time to load, even more because it is a mobile game. At the moment I’m trying to do so: public…
-
2
votes2
answers503
viewsGood practices when working with file processing
I have a web application in Asp.Net MVC with C# and received a new requirement where the goal is to read a text file with thousands of lines, each line containing a set of data that will be used to…
-
2
votes2
answers271
viewsList with large amount of items, excessive memory consumption
In my system I have a List<object>, While using the system I add items to it until I get to a certain point that the system starts to lock, to get very slow. My system can add up to forty…
-
2
votes0
answers461
viewsDynamically update ASMX web service reference
I have a C# application that consumes a webservice asmx (which is also developed in C#). Whenever I publish a new version of the webservice, I need to update the reference (of the webservice) in the…
-
2
votes1
answer341
viewsHow: Fill Object Collections from Multiple Sources
I would like a help in passing values to my property private IEnumerable<OrderDetail> orderDetail;. I would like to fill it in, but I have already looked for some examples and I have not found…
-
2
votes1
answer260
viewsDoubt Postbackurl
I’m trying to use the PostBackUrl in a LinkButton within the DataList. Tried the following, partially successfully. <asp:LinkButton ID="linkBtnMarca" CommandArgument='<%# Eval("Marca") %>'…
-
2
votes1
answer90
viewsInformation on Title - WPF
I have an application where the user can select the company to be worked on. When he selects, I would like this information to go to the Application Title... This is possible? The attribute Title is…
-
2
votes1
answer170
viewsApplication error when switching to enable 32-bit = True in IIS7
I use Cobrebemx in my Asp.net web application to print boletos. We switched server and now when I enable the option enable 32-bits = True for the "Application pool" of said application happens the…
-
2
votes1
answer1438
viewsConsume API fipe in C#
I’m doing studies in C# and Mysql. I created a combobox calling for Marca and another call Modelo. I want to run the FIPE api to look for vehicle makes and models. There is this address below…
-
2
votes1
answer69
viewsCreate Linq - EF List with n sublists
I have a list with N results, I would need to make some change in the list for this list to return N lists of only 3 underlying results. Any idea?
-
2
votes1
answer167
viewsSignalr loses connection when giving a Postback
The idea is to keep the user logged in to Chat as he navigates the pages. Layout of the components on the page Layout.cshtml function iniciarChat() { var chatHub = $.connection.chat;…
-
2
votes2
answers573
viewsQuery in a column with different values
In my project, I have a SELECT which brings me back two names, but these names are different. On my command, I need to return these two different names that are in the same column of the bank in a…
-
2
votes1
answer79
viewsList most frequent items in the database using LINQ
I would like to list on the screen, like a ranking, the most frequent items in the database table through its name, for example: John appears 6 times; Joseph appears 4 times; Mary appears 1 time.…
-
2
votes2
answers119
viewsWhat is the name of these parameters in ASP.NET MVC?
What is the name of these parameters between brackets used to restrict some access or define the protocol used, as in the example: [Authorize] and [HttpPost]. Is it possible to create a custom…
-
2
votes1
answer721
viewsEntity Framework associative table mapping
Abstracting some details I have these classes: public class Department: Entitie { public string Description { get; private set; } public DateTime CreateDate { get; private set; } public virtual…
-
2
votes1
answer385
viewsClass derived from Printdocument class C#
I have a class to print labels (Cprint), this class is derived from the class PrintDocument. It takes an image calling a method contained in the class Form1.cs. Follow the code of the class…
-
2
votes2
answers794
viewsGet information from the customer
This may sound like a silly question, but I’m kind of in trouble here. I need to collect through the browser some information that helps me identify the client that is browsing. I already know the…
-
2
votes2
answers310
viewsJson Array for C#string array
I just need to get the names of the moderators and viewers of this json: { "_links": {}, "chatter_count": 16, "chatters": { "moderators": ["gumagames", "juliavidoto", "nightbot", "pinkpanthersz_",…
-
2
votes1
answer1008
viewsHandle files with C#
The goal is to capture two string typed into two blocks of text and saved them in a file (this file is already predefined and the user will not know where it is). I also want to know how I read the…
-
2
votes2
answers1166
viewsHow to block a form after certain downtime?
Example: After 1 minute of inactivity the 'system' form is disabled and calls a 'login' form, after completing the login it returns to the 'system' form and activates it again.. Or it can be by…
-
2
votes1
answer55
viewsSql generated by Linq
Hello, I would like to know how to see the sql code that a String expression generates to be executed by ADO.Net. I am using Nhibernate as a ORM framework.
-
2
votes1
answer2950
viewsDropdown List from a table in the Database
I’m developing in Asp.net-mvc and I have the following problem: I need to create a dropdown list that displays the name of the instructors registered in the Database. CRUD is already working…
-
2
votes2
answers4299
viewsPicking attributes from an object using jQuery
How do I get the attributes of an object that is returned by a action in the javascript? This is my code ajax. Step the id for the action and it returns an object. I would like to access the values…
-
2
votes1
answer1049
viewsDate Issue in ASP.NET MVC
In my model I have the following field: [Column("sdt_DataReferencia")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] [Display(Name = "Data Referência")]…
-
2
votes1
answer67
viewsHow to open a meditation in c#
I have a class ZipFile in my project. In it there is a method called ExtractAll, which is the method used in my file extraction routine. I need to look at this method(if possible), because when I…
-
2
votes1
answer514
viewsASP.NET MVC Post Date Format
I have a form that sends via post the search parameters, but the parameter of type date whenever it arrives in the action the month and day are reversed, for example, I put on the page the date…
-
2
votes3
answers756
viewsLinq, doing Join comparing to Like
I have a question regarding Linq. As I have observed some codes, they usually use as an example: var _s = (from p in exemplo1 join q in exemplo2 on p.blabla equals q.blablabla I would like to know…
-
2
votes2
answers1144
viewsUpdate function to update date and time?
I have a Windows Form, on the control bar (where you have the Title, close and minimize) I also have the date and time: this.hora.Text = DateTime.Now.ToShortTimeString(); this.data.Text =…
-
2
votes2
answers62
viewsPass text instead of id on dropdown
I wanted to pass the text of the dropdown to the controller(Post) instead of the id, I don’t know how I can do this. Controller: ViewBag.AnoCatequeseID = new SelectList(db.AnoCatequese,…
-
2
votes0
answers43
viewsHow to round a decimal number to another nearest decimal?
So people are having a hard time creating a discount calculator. For example: I want a number x = 2,27 turn 2.3 and x = 2,24 stay 2.2. How to do this?
-
2
votes2
answers1730
viewsHow to update dataGridView by clicking a button?
I’m using an interface where I have the menustrip left and other form to the right, from there on menustrip has the options to novo(form charges nvCli) and busca(form charges nvConsCli), I need when…
-
2
votes1
answer1439
viewsHow to open an exe inside a windows form C#
I need to open a . exe inside a Windows form in C#, how to proceed with this. I already searched the net and found the following example: [DllImport("user32.dll", EntryPoint = "SetParent")] public…
-
2
votes2
answers498
viewsI can’t run an animated gif on my WPF project
I downloaded a gif. link. The problem that the link gives a double click and works. Drag to my application and no longer works. The image appears, but stopped and not moving. I want to put this gif…
-
2
votes2
answers515
viewsParameter query string Asp.net MVC
I need to avoid in ASP.Net MVC that a user simply changing the page URL has access to other data. Example, it can access the page www.dominio.com.br/usuario/1 and I need to block him from simply…
-
2
votes1
answer107
viewsGet Total Relationship Items 1:N
I have two Product and Items tables - these tables have Father/Son relationship respectively. I would like to know how to get the total of items in the Items table knowing that each customer can own…
-
2
votes0
answers40
viewsConverting String to Decimal?
I’m trying to convert a monetary value to decimal, the value 1.000,00. When I do the conversion and display only the whole number 100000 the decimal point no longer exists. How to solve this ? I’m…
c#asked 8 years, 6 months ago FernandoPaiva 1,562 -
2
votes1
answer1701
viewsHow to create a chart in ASP.Net
I’m trying to create a chart with the history of network usage in my company. I’ve never created a chart before on Asp.Net, so I don’t really know how to get started, and the examples I found on the…
-
2
votes1
answer1827
viewsIs there a difference between bool and Boolean?
Is there any difference compared to the types bool and Boolean? It seems to me that both have the same characteristics. I would like to know if there are differences between these types. Example of…
-
2
votes0
answers121
viewsPerformance when drawing an image
Currently I use the Drawimage method of the Graphics class. However, the speed of drawing in the components is very slow. How can I optimize its use ? Libraries like Monogame or Opentk can perform…
-
2
votes1
answer601
viewsXML Editing: How can I get the value of a property
I have a question to read and edit an XML in C Sharp. I need to get the value of the attribute "uuid" of the "Machine" node, this one is in the "Virtualbox" node. I also want the "Location" and…
c#asked 9 years, 3 months ago Marcelo Nascimento 403 -
2
votes2
answers721
viewsHow to run c# in the browser?
Is there any way to integrate HTML and C#? Or how to Debug to C#? So, this question I’m asking so that other people, who know program apps in C#, who are venturing into the Web world end up building…
-
2
votes1
answer114
viewsI’m creating a queue, and I can’t develop function logic for the previous object to assume the new position released - C#
I’m using unity3D, so my queue consists of Gameobjects, are 7 Gameobjects lined up next to each other and my purpose with this code is that every click of the user - "Simplemove function" - the…
-
2
votes1
answer95
viewsHow to put a "show more" on gridview
How to do this: Turn this around: The only thing I can imagine is putting a treeview inside the gridview, even so, I don’t even know if that’s possible. The doubt is only about the functional part…
-
2
votes1
answer103
viewsMy program has performance issues
I made this program with the help of the ramaral user. It is a Windows Forms program and has to run another console. The point is that I need that instead of this other program to open the console,…
c#asked 9 years, 2 months ago Marcelo Nascimento 403