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
votes2
answers783
viewsWhat better way to align columns of Datagridview C#
What is the best way to align the columns of a Datagridview, because if placed to align by the column name size is cut the cells that are larger than the column name size, and when placed to align…
c#asked 7 years, 5 months ago Nicola Bogar 1,149 -
0
votes1
answer180
viewsDefining a property within a Bsondocument
Salve galera! I’m working with c# Mongodb . Net Driver, and there’s something I don’t understand in the queries, follow the example: var dataBase = mongoClient.GetDatabase(dbName); var…
-
0
votes0
answers103
viewsHow to make an SQL query via Socket?
How to get the client to pass a query to the server and then return what the client requested? Example: Client passes the server to string: sql = "Select nome From Aluno"; and the server would have…
-
0
votes0
answers147
viewsProblems with PDF file
I am showing a PDF file directly in the browser. In Google Chrome, it works perfectly, but if you use Firefox, the PDF is as shown below. Did you have to put some extra config for Firefox? The PDF…
-
0
votes2
answers801
viewsUpdate Textbox without Postback
I need to update the change textbox when the textbox receives customer value, is filled, I use this function inside the textbox receive customer value in the event Textchanged: protected void…
-
0
votes0
answers701
viewsWhich encoding to use for CMD script?
Windows Command Prompt uses an ASCII table different from ours, which even I don’t know what it is. So much so that a batch with special characters when printed on the screen looks weird: Opção de…
-
0
votes1
answer54
viewsHow to create dependencies between Jobs on Quartz.NET
I have a Windows Services where I use Quartz.NET to schedule tasks on my system, but there are tasks that can only be performed after the (successful) completion of another. I found no documentation…
-
0
votes0
answers35
viewsInsert into Mysql txt file
I’m trying to insert a C# table into Mysql. For this I am using a txt file filled with table information and then inserting in Mysql, but it does not insert even though the file is created…
-
0
votes0
answers246
viewsPHP processes never close
Hello, I’m having a problem related to a PHP system running through a Windows Service. The application works as follows: I have a folder with several files and PHP scripts that serve as an offline…
-
0
votes2
answers1031
viewsHow to call an Html.Action("my page") via jquery?
I have a page that loads several partials views, I want to call in a modal a specific page that will fill the entire screen. I am using a generic jquery command to call an action that will be passed…
-
0
votes1
answer644
viewsProblems when working with dates in the database using a maskedtextbox in dd/MM/yyyy format
I am using a Maskedtextbox in BR culture to force the user to fill in the date in the correct format (dd/MM/yyyy). I remove the Maskedtextbox string to insert into the database and record…
-
0
votes0
answers431
viewsError trying to print document: The RPC server is not available
I made a software where one of the pages can be printed. On some computers it works normally and prints the page in PDF without problems. In others, when trying to print, the error appears: "The RPC…
-
0
votes1
answer174
viewsPopular Datagridview with Entity Framwork
I have in SQL Server a database called STORE; In this database I have a table called Funcio, it contains 5 columns and they are respectively: Name, CPF, Date, Date issued, Idfuncionario. In my C#…
-
0
votes1
answer79
viewsHow to compare directory path names?
I have two paths: C:\\anacarvalho\\Database\\Updates\\2017\\2017_04\\20170419_AC - Path selected by a Folder browser dialog. C:\\anacarvalho\\Database\\Updates - Path that is at the root of the…
-
0
votes0
answers223
viewsCapture ASP.NET MVC email attachments
all right? I am starting my studies in ASP.NET MVC (C#) and I wish you could help me with a problem that I am very lost. I need to connect in a mailbox and capture all attachments that have…
-
0
votes1
answer94
viewsControl number of user accesses in Windows Forms
I am creating an application in Windows Forms and would like to control so that users log in to a single station that is running the application. In an earlier version, my solution was to keep a…
c#asked 7 years, 5 months ago Marcel Pereira de Souza 3 -
0
votes2
answers1212
viewsHow to use and what is the timer function in C#?
//Exemplo de uso(Que não entendi): using System; using System.Threading; public static class Program { public static void Main() { // Create a Timer object that knows to call our TimerCallback //…
-
0
votes2
answers132
viewsPermanent focus on a field - WPF
I have an application with several fields, but I would like to leave the focus only on one specific and not allow the withdrawal of the same in any situation. Force the focus always in this field,…
-
0
votes1
answer328
viewsHow to have more than one column shown in a Combobox?
The question is the same as the title, I have a ComboBox called txtProfissional and set up the same way: txtProfissional.DataSource = modelOff.profissionals.Where(p => p.idUnidade ==…
-
0
votes0
answers24
viewsMy Getdirectories() only brings a directory, when there is 5
I have that line. DirectoryInfo dir = new DirectoryInfo(sourceDirName); Then I try to get all the subfolders, like this: DirectoryInfo[] dirs = dir.GetDirectories(); The Array dirs is only loaded…
-
0
votes1
answer92
viewsIs it a good choice to start a project with Diagram use cases, then class diagram?
I have an idea of software, but I don’t know if I should go directly to the class diagram and then the coding or if first of all I should use a use case diagram. I will work on this software alone.…
-
0
votes1
answer100
viewsI need to convert a string to int within an hql
I need to change the string to int, however it is located within an hql, I probably have to finish the query, but it error to enter the database, my code is a c# with Asp.net, mvc, nhibernate.…
-
0
votes2
answers2041
viewsHow to generate an automatic sequential number in C#
Good afternoon.. I have a txtbox1.Tex in my form, and I need to generate a 2-digit sequential number automatically. EX 01, 02, 03 and so on, and shows in txtbox. Could someone help me. Thank you.…
c#asked 7 years, 5 months ago Junior Guerreiro 617 -
0
votes2
answers169
viewsShow date in Messagebox C#
I have a date vector with the values already entered, but I wanted to show the values one by one, so I created a "for" that did this Dataavailable is my date vector, with values already allocated;…
-
0
votes1
answer136
viewsby checking a field filled in a select in the database
Good morning... I’m in need of a help from the forum, and nen know how to do it in the c#. I will try to explain, I have a form and in this form I have a button that generates a code of two…
c#asked 7 years, 5 months ago Junior Guerreiro 617 -
0
votes1
answer251
viewsRPT file conversion to PDF c#
Good morning I have the following file on .rtp and, I need to convert/transform the data in that report to pdf. Saldoestoqueempresa.rpt I need it done through a click event.…
-
0
votes1
answer195
viewsDynamically hide a Webgrid column
How can I hide at runtime a column from Webgrid ? For example, I want to hide the column Parametro, it would be something like that: grid.Column("Empresa", "Empresa"), if(item.valor1 == X){…
-
0
votes0
answers70
viewsC# - Is it possible to place a Scrollbar inside a Menustrip through the code, without touching the design?
Hello! I am using Windows Forms and created a menu with many items: In order to view all the items I have to use these arrows that are on the menu ends. I wish I could add a Scrollbar or something…
-
0
votes1
answer157
viewsDisplay a wait message while downloading a file
How to display the wait message during file generation and compression for dowload ? I’m doing generation, compassion and Generate more than one PDF in memory and export it in a compressed file…
-
0
votes1
answer1685
viewsC# - Display search results in Datagridview (SELECT SQL)
Hello! I’m actually starting at C# and I already have small projects. I can already connect to the remote database, I can already run queries, I just can’t get the result of a Select and show in a…
-
0
votes1
answer94
viewsHow to create a file filter by dragging in C#
I am implementing the Drag files function to fill a Listbox with the file path. It works very well, but I would like to put a "filter" making it possible only to import txt. if it is not txt should…
-
0
votes1
answer19
viewsChange Toolstripstatus value while typing in Richtextbox
I’m developing a little text editor just to practice. But I ran into a little problem, i wanted that while the user is typing, the value of Toolstripstatus that by default is 'READY', wanted to…
-
0
votes2
answers591
viewsIn a Textbox, with the property Multiline true, character n does not change line
In a Textbox the character \n does not change line text, example: textBox1.Multiline = true; textBox1.Text = "IMPRIMEEMCIMA\nIMPRIMEEMBAIXO"; However \t works. I also noticed that on a label the…
-
0
votes1
answer61
viewsReportviewer - Methodaccessexception
Good afternoon, I use Visualstudio 2015 Community on a Windows 10 x64 and am encountering the following problem when running the debug of a Windows Form Application project:…
-
0
votes1
answer1615
viewsHow to insert control key in c#
Someone could help me, wanted to create a command with the keys CTRL + Z or something to save, edit or send data, as a shortcut to a button created on Form.…
-
0
votes1
answer497
viewsManipulate Printscreen in C#
A while ago a guy here at the forum helped me to put together a program to take a photo of a specific window that had opened on the computer. I wonder if I can get this picture instead of the whole…
-
0
votes0
answers246
viewsI can’t make a reference to a project
Hello, I’m with a MVC Solution divided into 4 projects: Model, Persistence, Contoller and View Persistence has a reference for Model Controller has 2 references for Model and Persistence I’m trying…
-
0
votes3
answers1019
viewsReturn Notfound() Web Api c#
I need that if the return of Get of controller below for null he returns a specific message, where he has return NotFound(), but it’s not working as expected and I tried to implement separately but…
-
0
votes1
answer702
viewsQuery image in a folder
I am creating a program in windows form and in this program I would like to select an option in the combobox and it load the image in the picturebox. This image will have the name that was selected…
-
0
votes1
answer106
viewsPull the last information from a table
I wanted to know how to pull the last information that was registered in the bank, but I can’t use the ID. in my Route table have the columns Id(PK), Date, Current Km_and Nveiculoid(CK). In this…
-
0
votes1
answer790
viewsSUM within SUM Entity Framework performance
I made a query with Entity framework and I’m having problems with performance. public static Decimal ValorPrevisto(this ClinicaModel clinica) { return clinica.Contratos.Sum(c =>…
-
0
votes1
answer202
viewsMy oracle BD search does not fetch result
I have a method, using Ado.Net to bring information from BD(Oracle 11g). There is information in table(6 records) and when run by C# no record. See the code below: public class ConexaoBanco { string…
-
0
votes2
answers897
viewsWebservice in C# with 404 error
I’m doing maintenance on a C Project, which has Webservices. I created a new service and ran the program, it works as images below, but calling the method gives error 404. This is normal behavior?…
-
0
votes1
answer179
viewsCrystal Reports Displaying Strange Values
I’m starting in CR and I’m having a hard time generating a report in Crystal Reports from visual studio 2008. It is not displaying values from my database table. The datasource I am using in the…
-
0
votes1
answer48
viewsC# is not finding/recognizing my List
I have a List made with the following code: List<frase> frases = new List<frase>(); According to the documentation of System.Collections.Generic, my code is right. But for some reason C#…
-
0
votes0
answers25
viewsProject not found when trying to install Entity from Nuget
The drop-down list where all my Solution projects are or should be listed, is coming in blank. What should I do to list the projects there? I’ve already given a rebuild and it’s still empty. The…
-
0
votes2
answers678
viewsDDD C# - In which layer should I implement the Data export part
I am developing an application in C# and WPF, with several registrations as Customers, Suppliers, Products, etc. I am using the DDD concept and I have a question about how to implement a data export…
-
0
votes0
answers464
viewsHow to load Partialview via Javascript
I have an Asp.Net MVC project where there is a method that returns a PartialView: [HttpPost] public ActionResult MinhaAction(int param1, int param2) { // ... // Código // ...…
-
0
votes1
answer414
viewsQuestions with XML Mapping
I have a file XML as below and I have some questions regarding how to map it to make the deserialization. I am using C#. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>…
-
0
votes1
answer36
viewsDelay in Angularjs used in file . cshtml
I have a page that when starting it gives a Daley in the checkbox and in the text field as in the figure below: someone knows me why this happens, and a possible solution…