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
votes2
answers155
viewsDifferences between arrays declarations
What’s the difference between declaring a matrix like this: 'C# string MinhaMatriz[] = [] 'VB Dim MinhaMatriz() As String = { } and so: 'C# string[] MinhaMatriz = [] 'VB Dim MinhaMatriz As String()…
-
2
votes1
answer584
viewsHow to debug in C#?
How to debug in C# taking as reference the simple form of PHP that is usually used var_dump or print_r? I have a C# object but I don’t know how to know what’s in its structure.…
-
2
votes1
answer216
views -
2
votes2
answers107
viewsApplication database query made in C#
I am creating an application in C#, but a question came to me. Which database is used so that it is not necessary to install the database in the client’s system? For example: If I were to use…
-
2
votes1
answer123
viewsStored Proc X Entity - Is this a good decision?
On Entity Framework days, is doing an MVC project using Stored Procedure a good way forward? I have always heard this: If you opt for RU it makes no sense to use SP, but I have heard people say that…
-
2
votes2
answers1192
viewsData entry in C#database
My class Cliente: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Objetos_de_Transferencia { public class Cliente {…
c#asked 9 years, 3 months ago Antonio Goncalves 29 -
2
votes0
answers33
viewsWhat is the possible cost of using blocks for exception treatment in too ?
As exceptions are interruptions caused most of the time by the operating system, I wonder if there is any cost of memory (stack/heap) since, existing exception treatment the program continues to run…
-
2
votes2
answers196
viewsError Searching for Serial Postgresql
Using: c#, windows Forms, postgresql I’m having trouble putting together a routine which saves data to a table and retrieves the id recorded(serial / Sequence) and updates the log in another table.…
-
2
votes2
answers2457
viewsSubtract dates and compare with value
I have two dates: DataAcesso and DataAtual of the kind DateTime. I have one more field called TempoAtualizacaoAutomatica typo byte. I need to subtract these dates and compare the result with…
-
2
votes2
answers473
viewsEnd of ASP.NET Webforms?
I wonder if there is a certain trend in ASP.NET Webforms if "retire", leaving only ASP.NET MVC, because according to this article the answer would be yes. The author of the article (Ramon Durães) at…
-
2
votes1
answer302
viewsDropdownlist with checkbox
Would anyone know a way to make one DropdownList with checkbox? I have the following Dropdownlist: @Html.DropDownListFor(model => model.CD_AFFILIATE, new SelectList(@ViewBag.list,…
-
2
votes0
answers124
viewsHow to break the page using Nreco.Pdfgenerator in ASP.NET/C#?
I’m using CSS to break the page, I’m putting it inside a <asp:Repeater> In the first break everything happens well but in the third page it breaks incorrectly (in the middle of the page).…
-
2
votes1
answer1065
viewsCanvas Search Field (ASP.Net - MVC)
Good afternoon, I wonder if someone could help me. I’m a beginner in programming, and I’m developing a Web system, and I need a screen search of the screens you’ve already created. As I use the MVC…
-
2
votes1
answer54
viewsRefer to the "parent" of the class
How do I reference the "father" within the method? I remember that in Java it was only used this, but in C#? Example: public class UPlayer : RocketPlayer { public void SendMessage(object obj) {…
-
2
votes2
answers931
viewsSelect returns nothing at all
I have the following method: public DataTable Select(bool all = true, string campos = null) { if (all && campos == null) _sql.Append("SELECT * FROM "); else _sql.Append("SELECT " + campos +…
-
2
votes1
answer402
viewsWhat is the best way to develop a video player from scratch?
Well, I would like to know what topics, articles books finally references would help me in the task of developing a video player from scratch as the average classic player for example?
-
2
votes1
answer238
viewsRemote validation preventing data editing
I am using remote validation to prevent repeated emails in the database, which works well, when I do some registration. The problem is that the remote does not accept the original registration…
-
2
votes2
answers1371
viewsSelenium, how do you control the speed of the test run?
Creating automated C# testing using Selenium, I want to know how to control test execution speed?
-
2
votes1
answer1692
viewsDataannotation: How to validate "e-mail" property, check whether or not it exists in the database, with attribute other than in the client and yes in the Server
I have a layered application, and in my presentation layer, I have a ViewModel that is UsuarioViewModel inside this I have a Property calling for public email {get; set;}. Already this validating…
-
2
votes1
answer3512
viewsAdd buttons to the Datagridview cell
I am developing a Windows Form C# activity control application for a company, however I would need to display activities such as buttons within the cell of GridView. I’ve tried to:…
-
2
votes2
answers313
viewsHow to create an input grid in Asp.net C# - MVC5
Basically I have a form and I am opening a window (modal) with a list of employees and by javascript I can add the email of the same in the form that will be saved, in another language in this case…
-
2
votes2
answers70
viewsInstall an application
What is the best and simplest way to create a customizable C installer#? Ex arquivos: \bin32\dedicated.exe \bin32\server.exe \bin32\sdk.exe \etc\lib.def \etc\resume32.def Make the application do the…
c#asked 9 years, 2 months ago FRNathan13 2,183 -
2
votes2
answers585
viewsError When Receiving POST in Paysafecard
I have a platform that makes purchases via Pagseguro form. The problem is that I’m only receiving the POST in which the StatusTransacao is as "Waiting for Payment", ie in the case of a billet…
-
2
votes1
answer1899
viewsCalling the browser digital certificate
How do I call the browser digital certificate so that my webapp on Asp.net mvc can sign an xml and then return it to the user? I have seen features that use java or another applet, but I would not…
-
2
votes1
answer677
viewsHow to do the mapping (Entitytypeconfiguration) of this complex type?
My application Numerators follow the 'secure enumerator' design pattern, where I have the enumerator statement as static members, and the Numerators instance following a contract (Ienumeradorseguro…
-
2
votes1
answer369
viewsOne-To-Many relation with explicit Foreign key name
I’m performing a simple mapping of one-to-Many via Fluent API specifying which column is used in the mapping, however EF "ignores" the configuration and continues using the name default. Mappings:…
-
2
votes4
answers6715
viewsHow to clear form fields in c#?
I’m doing a project for college, I created a GroupBox and inside there’s RadioButton, Label, MaskedTexbox and TextBox. When I click the cancel button I did the cleaning of the MaskTexbox and TextBox…
-
2
votes1
answer370
viewsHow to read text from a Word document text box via C#
I am using Interop to manipulate a word, through an application console. using Word = Microsoft.Office.Interop.Word; I can extract the byte array, save as PDF, as image etc, but a relatively simple…
-
2
votes2
answers443
viewsQuery an XML file - C#
I have an application in windows phone 8.1 where an XML file is displayed in a listBox, and in this application has a textbox for the user to search the content that is displayed by listbox. My…
-
2
votes1
answer393
viewsHow to add an HTML element to the PDF via iTextSharp?
itextsharp allows me to add your PDF elements, example: _documento.Add(new Paragraph("Olá")); But I would like to add some elements of HTML such as a <h1>, or a <p>, how can I do?…
-
2
votes1
answer1272
viewsHow to change the name of the target database when performing the restore? (Restore C# .net class)
I am backing up and re-storing an SQL Server database using the C# NET Backup and Restore classes with Smo. The problem is that after backing up the database with the name, for example "Test", I…
-
2
votes0
answers36
viewsAnimation with dependency Property
I’m studying dependency properties in WPF. In all the articles I read I cited the use of this resource in the animations, but I could not find any application. What is the advantage of using a…
-
2
votes2
answers108
viewsC# and Mysql with Aspnetusers, deleted tables
I am developing a system with C# (MVC) and Mysql. Everything works perfectly well when using my local database instance. I duplicated this database on Uolhost and that’s when something bizarre…
-
2
votes1
answer235
viewsImplement Interfaces
I have the abstract class ClasseA and 2 child classes ClasseB and ClasseC, then I have an interface IClasse which is implemented in ClasseA and ClasseB. In the interface I have the method metodo1…
-
2
votes2
answers153
viewsAlternative to the use of new when implementing methods that return this in child classes
Taking the example of the following code: public class Pai { protected string PropriedadeA { get; set; } public Pai Metodo1(int valor) { //Vários procedimentos feitos aqui PropriedadeA = "Resultado…
-
2
votes1
answer241
viewsHow to export Reportviewer to Excel while maintaining field types?
I have a report in Viewreport in VS2010 and when I export to Excel, the default VS button does not maintain the format of the fields. This way I cannot use Excel functions as SUM for example because…
-
2
votes1
answer779
viewsMultiple config files in different ASPNET MVC projects
I’m in trouble and maybe someone can help me. I’m working on a project ASPNET MVC so that I structured the solution in several projects to decompose the different components. In my main project…
-
2
votes1
answer1315
viewsError while exporting to Excel (Corrupted file)
I am making an application to export the result of a query sql for Excel. After the file created the time I will open it gives a corrupt file error. SaveFileDialog sfd = new SaveFileDialog();…
-
2
votes1
answer1608
viewsHow to convert a Decimal value to Datetime?
Can anyone help me with the following question? I have returns of two variables. Examples: 1st - of the type decimal (vdecTotalHoras) and the 2nd - also of the type decimal (vdecMediaAnalise), both…
-
2
votes0
answers82
viewsIncorrect double sum of values!
In a client the sum of 10 lines in a table should total 100. The problem is that the reported values total 100 however when adding, even if fail in the code to avoid garbage coming from the…
-
2
votes1
answer57
viewsOnmouseup() method does not work in unity4
Hello! I’m new to Unity and I can’t make the Onmouseup() method work using UnityEngine; using System.Collections; public class touch : MonoBehaviour { void OnMouseUp() { Debug.Log("Drag ended!"); }}…
-
2
votes1
answer225
viewsList files from a directory by approximation
I have a screen where I list files from a certain folder. I have a search bar that uses the same method to find files, but I can’t list by approximation. Example: I have this file…
-
2
votes3
answers668
viewsUppercase Method for Metroframework
I need help in TextBox, where I work in c# using Metroframework. I need to turn all the typed text into TextBox in capital letters. How can I do?…
-
2
votes3
answers517
viewsCreate FTP access to a virtual directory on Azure
I have a Web App on Azure and created an internal folder as a virtual directory for a third-party developer to deploy a contracted system. I’m having great difficulty creating an FTP that only has…
-
2
votes1
answer446
viewsTwo submits on the same page
I have a page with a list of checkbox and with two buttons: One is to View and the other to Send the report by e-mail. That is, the user will select the fields he needs to see in the report and he…
-
2
votes1
answer336
viewsResponse.Redirect() without generating System.Threading.Threadabortexception?
At every point in the system it has a Response.Redirect("/Url.aspx"); Generates the type Exception System.Threading.ThreadAbortException, but it works. There is some way to do Response.Redirect,…
-
2
votes1
answer80
viewsFilter by group and minimum value
I have the following table: ********************************* * IdPessoa * DataVen * Observ * * 10000000 * 01/01/15 * Teste1 * * 10000001 * 01/01/15 * Teste2 * * 10000000 * 01/01/12 * Teste3 * *…
-
2
votes2
answers321
viewsScript to make a div appear
I have a user registration in my application, when I click register wanted to show a message. This whole treatment I’m already doing and playing the message in my Viewbag.Message. How do I show this…
-
2
votes2
answers3293
viewsDatetimepicker, get first and last day of the month
How do I take the first and last day of the previous month, to fill a DateTimePicker on screen? Ex: Data Inicial 01/07/2015 Data Final 31/07/2015…
-
2
votes1
answer876
viewsWebrequest 504 Gateway Timeout
Eai guys, I’m having a hard time understanding why is giving gateway timeout in a request, since I tested by Curl and was normal, I’m using Basic Auth. Follows: var authorization = "apikey:";…