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
answer745
viewsSet listview cell color for specific words
I need that when loading specific data in the listview the cell in question is formatted with defined color. The code below formats the entire and accurate row that format only the defined cell.…
c#asked 8 years, 5 months ago Philipe Said 138 -
0
votes1
answer209
viewsFilestream file directory and extension
How to specify the file creation directory and its extension? byte[] vetorImagem = (byte[])cmdSelect.ExecuteScalar(); string strNomeArquivo = Convert.ToString(DateTime.Now.ToFileTime()); FileStream…
c#asked 8 years, 5 months ago Marlon Pereira 465 -
0
votes0
answers29
viewsC# RLDC - Group report
I have two tables: Product and Category. I would like to display all products, grouped by their categories. I am using Parent Group and it works perfectly, but I would like to display the category…
-
0
votes3
answers7251
viewsHow to read keyboard numbers in C#?
I know that getchar() gets keyboard characters by stdin, but I want to know how to enter numbers into a variable. For I use getchar() and type a 2, for example, the variable becomes 50, and it’s…
-
0
votes1
answer57
viewsHow to import data from Datagridview to textboxs
As I do,when I click the modify button bring the data from a Datagridview row to the top fields and also if I save as inactive leave the line as Enabled = false.…
-
0
votes0
answers42
viewsHow do you update the dates of a project done in C# Asp.net MVC layers?
When creating a Blanck Solution type project and creating Class Library type projects with in my case, creating 3 projects in addition to the type application (Application, Domain and Repository) i…
-
0
votes1
answer1460
viewsColorize line in datagridview c#
I’m trying to use the following method: for (int i = 0; i < dgvRequisicao.Rows.Count; i++) { valor = Convert.ToDouble(dgvRequisicao.Rows[i].Cells["valor"].Value); if (valor > 20000.01…
-
0
votes1
answer78
viewsAdd Treeview Node by path
Estu trying to add one TreeView Node by path, for example: And the code I’m trying is like this: public void AddParent(string path, string node) { TreeNode parentNode = treeView1.Nodes[path]; if…
-
0
votes1
answer1033
viewsWebdriverexception when not finding elements with Findelements
When I try to check if an element exists or not on my website and if the element does not exist, my Iwebdriver launches a Webdriverexception, and all of my driver’s methods stop working, making it…
-
0
votes3
answers394
viewsIs it possible to add string Connection within a class?
I have a project of my own class library where I have my Context, in it I take the SQL connection that is in my web.config. How could I add the SQL connection so it stays inside the DLL? I want to…
-
0
votes1
answer230
viewsMore efficient code for making an iTextSharp template in ASP.NET MVC?
I only did a project to generate PDF’s using the iTextSharp library in ASP.NET MVC (C#), however I would like to know which code is most efficient and easy to use to have a template that generates…
-
0
votes3
answers997
viewsaps.net C# Renaming an image name
I have an image in a folder and I wanted to change its name only someone can help me thank you example: original name.jpg went to: desired name.jpg
-
0
votes1
answer33
viewsstring.find(), what if I want to create something similar?
Guys, I’d like to know how these "things" work in which I don’t know the name, in the case string.find(), string.copy(), string.Rase(); All I know how to do is stringpick(string). Remembering that I…
-
0
votes0
answers2413
viewsC# windows appication Event: Clr20r3 on application start
I created a windows application Forms c# . net 4.5, in my development environment works perfectly, but when I put the release in the client environment, give the following error when starting:…
-
0
votes1
answer340
viewsHow to create C# method to do 2 Query SQL Insert?
To create a c# method to insert data, this method does more than one INSERT behind the other? 'Cause I tried it here and it didn’t work out!
-
0
votes1
answer37
viewsClean Form1 and add new things like the game maker’s Rooms system
Oops! Guys, how do I clean a form and put new elements inside? For example: Something like an installation screen when we click Next. Edit1: For example, this screen: Flip this screen by clicking on…
-
0
votes1
answer157
viewsA 'tremida' effect with while?
I’m using the following code inside a Timer: void dt_Tick(object sender, EventArgs e) { double x, y; int cont = 0; x = tt.X; y = tt.Y; while(cont < 5) { tt.X += cont; tt.Y += cont; cont++; }…
-
0
votes0
answers1600
viewsWebservice in C# Reading Xml
Good afternoon, I am building a Webservice in C#, I created a method that reads an XML sent as a request and should return the student’s name... The problem I’m actually facing is when I try to…
-
0
votes0
answers60
viewsQuestions with navigation and FK properties with Code First
Why in this code was identified as foreign key the Idgroup property and not the navigation property and what would be the correct form of the foreign key application? public class Grupo { public…
-
0
votes1
answer258
viewsASP.NET MVC Integration of accounts with office365 authentication
I have a project in Asp.net MVC 4 and the users registered by the system itself, however the need arose to authenticate them by office365, that is, when accessing office365 the system recognize the…
-
0
votes1
answer150
viewsHow to get the text of the line where the cursor is positioned?
I have a textbox, and I need to get the content of the line where the cursor is positioned. For example, I am in the third line of the textbox (cursor positioned on it), I would like to get the…
-
0
votes2
answers622
viewsErrors Script C# Unity3d 5.2.0f3! Errors with Rigidbody2d
I have a problem with a C# code that I am using to make a game in Unity3d Version 5.2.0f3 This Code I picked up on a video of Playing with Nils ( Youtube channel that teaches how to develop games.…
-
0
votes1
answer103
viewsDoubts about table of states and cities
Friends good morning. I have a question, on the best way to fill a combobox with information of State and other with information of city. My doubt, consists in, what would be better in question of…
-
0
votes1
answer456
viewsC# Windows Form - Doubts about Session
I need to save information for as long as the user is logged into my software, I searched and saw that for web pages made with ASP.NET there is the object SESSION, but and for Windows Form? the…
-
0
votes1
answer237
viewsWhat to use to connect to the internal-only Web Api
I’m a beginner and I built a mobile application in C# that connects to a Web Api. However, the Web Api will be on a server that has only internal access, which would theoretically protect the BD.…
-
0
votes0
answers253
viewsUsing Claims to replace Sessions
I am refactoring an application that I am developing, applying good practices in ASP.NET MVC, there arose a difficulty in understanding Claims and how to apply it to replace the Session use. When I…
c# asp.net-mvc-5 session authentication asp.net-identityasked 9 years, 2 months ago Anderson Souza 376 -
0
votes1
answer122
viewsRelease with Report does not run on other Pcs
I created a Winform that contains Reports searching for data on an object DataSet (which is programmatically populated using an SQL Server source). The release is stored on the server and can be…
-
0
votes0
answers377
viewsIn which layer turn Domain into DTO
Hello, in an Asp.Net MVC application the architecture has domain entity classes, Dtos and Viewmodels. The transformation of the Viewmodels I do in the controller, so far so good, but in which layer…
-
0
votes1
answer54
views"Textwriter sw" Formatting
I am using "Textwriter sw" to send to Word turning the textboxs into doc the problem I need some formatting. How do I set paragraph size, line spacing, etc... The code I’m using to send to Word is…
-
0
votes1
answer211
viewsC# in form 2 does not show string in label
I don’t understand why Form 2 doesn’t show label text in form 1. form 1 private void button1_Click(object sender, EventArgs e) { string Username = textBox1.Text; HelloForm HF = new HelloForm();…
-
0
votes0
answers680
viewsFirebird C# create a single connection to the database
I need to create in my application only a connection using the fbconnection that will be shared across the application. I performed this procedure as follows. I created a static class that provides…
-
0
votes1
answer2213
viewsC# When you open form 2 wait 5 seconds and open form 3
I need that when loading form 2 the program waited 5 seconds in order to automatically open form 3 as I do this? private void LetTheGameStart_Load(object sender, EventArgs e) { timer1.Start(); }…
-
0
votes2
answers106
viewsUntil the progressbar value reaches 100 do not close the window
Before you start, it’s not really a virus, it’s a game. I wish that while the progressibar does not reach 100% could not close the window by clicking the button and a popup appears saying that it…
-
0
votes1
answer224
viewsJOIN by LINQ in C#
I need to make a Join by LINQ in two lists using codeList. List 1 must exist in the second list (list 2) and must be returned. How do I do that? Obs.: I never Join via LINQ in c#
-
0
votes1
answer270
viewsHow to remove Essentials Web extension from visual studio 2015?
I added this extension in Visual Studio 2015 to test, but it disables all native commands of Visual Studio, I wanted to remove this to never install again.…
-
0
votes1
answer53
viewsHow to make a Combobox with Gridview?
I’m trying to make a Combobox that then click is filled with a Gridview, I know it’s from Devexpress, today I use version 16.1. example:…
-
0
votes2
answers216
viewsPerform Insert into in c#List
One could give an example of what an sql Insert would look like in a list in c#?
-
0
votes1
answer178
viewsHow to verify integrity or violations in SQL Server database?
I created an application to run in the background to back up my SQL Server database using the class Backup of Microsoft.SqlServer.Management.Smo. I would like to add to this backup tool something…
-
0
votes3
answers2379
viewsSet minimum number of characters in Textbox
How can I define a minimum amount of characters that should be put into a textbox? I’m using Visual Studio 2013, creating an aspx site.
-
0
votes2
answers2265
viewsPopular table using Json
I’m having a hard time getting a table in my code cshtml. I’m new to the ajax and I’m not really understanding what I need to do with the data that came from the bank. Just follow my code: Code…
-
0
votes1
answer226
viewsDraw outside a form area
Using C# with Windows Forms Application project type is it possible to draw things out of the form? I would like to draw a square that can be stretched by the mouse and repositioned, where I should…
-
0
votes1
answer32
viewsCreate textboxs in a user-determined amount?
In a form the user will be able to choose the amount of images he can put, for each image I must create a texbox to put the URL of each image. He will determine this amount through a NumericUpDown,…
-
0
votes1
answer174
viewsCalculator does not detect two-digit numbers
I’m making a calculator in c#, but calculator, I don’t know why, it doesn’t detect numbers with 2 digits, like 11+1 = 3, the calculator is detecting as if it were 1 + 1 + 1. Follow the code: using…
-
0
votes1
answer288
viewsMap to Unity3d
I am developing an application in Unity3d that resembles the Waze application, but for this I will not be able to use a Google Maps API, for example, Static Maps, because I will need something that…
-
0
votes0
answers99
viewsHow to Grid with Levels
Would anyone know how, to make a grid with two levels and Winform? example below: thank you.…
-
0
votes0
answers493
viewsBursting of Memory (RELEASE)
I’m having a little problem with my code... is eating a Braba memory... and is not pouring memory ... a simple application within my program... Label printing... every time I print a label the code…
-
0
votes1
answer749
viewsHow to create loop thread in c#?
How do I create a thread that runs a function, wait 1 second and loop again until the program shuts down?
-
0
votes1
answer331
viewsFormat Windows Forms text
I have a system and I need to justify the text to the left, I have tried with the textbox and with ritchtext and neither of the two give me this option, I can only align the left, but when I align…
-
0
votes1
answer543
viewsCalculation in a Datagrid. C#
Hello. Is there any simple way, working directly with the db to make calculations in a datagrid cell. Situation: I have a Column Qtd, another ValorUnitario and another ValorTotal of a certain item.…
c#asked 8 years, 3 months ago Maurício Sanches 487 -
0
votes1
answer59
viewsUsing Factory and Controller to handle Json
On this website Andrew Mcgivery I found this very interesting example: .controller('UserCtrl', function($scope, $stateParams, userService) { var user = userService.getUser($scope.id); })…