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
-
6
votes4
answers6579
viewsResize image
Well my system has an area where the user registers information about the site. So register images. The system does not restrict image size. Then on the site are presented the images. However there…
-
6
votes2
answers112
viewsCheck which processes are connected to the internet
It is possible to check which processes are connected to the internet and what is their destination?
-
6
votes2
answers1410
viewsFile upload does not work on Locaweb hosting
Locally I can upload the file and save quietly in a folder using the following code Controller: public ActionResult CriarProduto(FormCollection form, HttpPostedFileBase file) { Produto produto = new…
-
6
votes2
answers1179
viewsInsert image into SQL database SERVER2008 using image path
I’m starting in C# and I’m having difficulty inserting in a picturebox an image as in the image below: The screen above is a photo registration, and the search image button works, but I do not know…
-
6
votes2
answers294
viewsI Can’t Make Reports
It’s not about how to do it. But I can not do everything because the Reporting that brings the report Viewer for drawing the report does not appear, I have tried to find it in several ways but it…
-
6
votes1
answer368
viewsDesign Observer applied to events
I’m studying design standards and I’m trying to apply a real situation to them. And one example I did was on the event stage: In this scenario every event has participants to register. So, for that,…
-
6
votes4
answers3066
viewsHow to make a Hello World on ASP.NET MVC?
I already program but I’m starting with C# and ASP.NET MVC. I wanted to do a program Hello World and gradually add things as I’ve always done with any language I’ve learned. I thought creating a…
-
6
votes1
answer5859
viewsWindows Service - ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I have 2 projects (Webforms and Windows Services) in . Netframework 4 that connects to Oracle base via Obdcconnection. In the Web project I can successfully open the connection... But in Windows…
-
6
votes3
answers1195
viewsEntity Framework many relationship x many extra field
Good morning, I’m studying the Entity Framework Code First and I’m wondering how I should create an Nxn model with extra information in the relationship table. For example: Let’s assume the…
-
6
votes1
answer2411
viewsBlock keyboard and mouse or prevent user from leaving window in C#
I’m developing a lock screen style of lan-house where the user does not leave the screen without the server’s permission, I would like to know if it has to prevent the user from using keyboard and…
c#asked 9 years, 7 months ago Pedro Soares 1,136 -
6
votes3
answers407
viewsHow to implement the standard presented in C# with Entityframework?
I’m thinking of a way to apply the pattern (multi-tenant), raised in that question (Standard that has contributed to the reliability of software that needs to meet complex models such as…
-
6
votes2
answers599
viewsStatic classes and classes with static methods
When I declare a class static, I am obliged to write my static methods and this class can never be instantiated. Now, I have a common class and I create my methods within it all static. Well, I do…
-
6
votes1
answer384
viewsHow to read/translate the Yield keyword?
I’m studying about the keyword Yield in C#, and I have this question: how to read this word in Portuguese (structured?). Would something like "return the current value of the enumerator"? Wouldn’t…
-
6
votes3
answers1158
views'NT ANONYMOUS LOGON AUTHORITY' failure in SQL Server 2012 on remote server
I have a legal application running on my local server. I made some changes to it and prepared to publish an approval environment for testing. How we are migrating local banks and servers to a new…
-
6
votes3
answers2029
viewsSave to Notepad C#
I wonder if someone could help me with the following. I intend to put a button in my program, which by clicking, save the content of a Textbox in a Notepad Document in the folder we want.…
-
6
votes2
answers1419
viewsAlternatives for VBA development in Office
At work I have a large code base written in VBA (approximately 13 active projects), both for Access or Excel applications. I’ve been trying to refactor some things, but several factors are making my…
-
6
votes1
answer699
viewsWhat tools are available for code coverage in . NET in Visual Studio?
I have developed systems using TDD in .NET. Recently, the company I work with, bought the version of Visual Studio 2013 Pro and, in this version we do not have the code coverage tool (code…
-
6
votes2
answers8444
viewsPass generic list as parameter
You can pass a generic list by parameter? Ex: I have one List<Pessoa> and a List<object>. and I have my method: public void FaçaAlgo(List<T> lista) { } How can I make my method…
-
6
votes1
answer1437
viewsRetrieve information from digital certificate
I’m working with digitally signed PKCS#7 PDF files. I searched the Internet and I can’t find a way to retrieve subscriber information. Using the class SignedCms I can even get some information when…
c# cryptography certified digital-signatureasked 9 years, 5 months ago Gabriel Henrique de Souza 61 -
6
votes2
answers328
viewsShow white space for Null value in Views
When I send some value null for my view, and Razor tries to render the value, is returned a Exception. There is a way when the view receive a value null, render this as a blank space without having…
-
6
votes3
answers1631
viewsHow to add Directory to the Windows Path variable during installation?
I developed an application like Console in C# with Visual Studio 2013 and wanted the installer to add the solution directory in the variable Path Windows, during installation. Is this possible? What…
-
6
votes1
answer1356
viewsAccess html objects in code in Asp.net c#
I have a page that contains objects Asp.net and html. How do I access design html objects in . Cs with C# ?
-
6
votes2
answers830
viewsConversion from date string to datetime C#
I have a method that will receive a string in the "June 15, 2001" format, for example, which is equivalent to the date to be compared, I need to pass this string to a Datetime, as I would do this…
-
6
votes1
answer935
viewsModular Programming
Something quite common in the development of systems for business and how to satisfy several requirements, being these requirements often not used by certain customers, such as when a sales company…
c#asked 9 years, 9 months ago Pablo Tondolo de Vargas 5,444 -
6
votes1
answer276
viewsWhat is the assignment in Action parameter method for?
I had a question regarding some codes I found in a project of a former employee of the company. It is a code that contains assignment in the parameters of the variables. Below follows an example:…
-
6
votes2
answers4042
viewsGet property values of a class
I have the following codes: private PropertyInfo[] ObterPropriedades(Type classe) { PropertyInfo[] properties = classe.GetProperties(); return properties; } private string[]…
-
6
votes1
answer134
viewsAuthorization in class Ibraries
Doubt I’m with a project in which all business rule is encapsulated in a set of DLL’s with 3-layer architecture. I would like to know, what is the best approach to authorization control in these…
-
6
votes1
answer306
viewsC# application with Firebird connection error on Windows 7 32/64 bit with 2GB RAM
Hello! I am developing an application in C#, in which I have already installed it in several machines for testing with windows Xp, 7 and 8 and in all of them the application worked correctly, but in…
-
6
votes4
answers579
viewsGet the date and time the computer called
I would like a method to get the date and time the computer last connected with (c# windows form application).
-
6
votes2
answers1307
viewsWhat does a "Thread Safety" class mean?
According to the MSDN to Webapp Class (Microsoft.Owin.Hosting) is Thread Safety. What exactly does that mean? This class specifically has a method Start that: Start a web app.... Every request to…
-
6
votes4
answers4566
viewsHow do I update my data in the table using the Entityframework?
var contactado = ContactadoRepositorio.ObterListaContactadoPorCodigo(procedimentoVM.CodContactadoPessoa); //obtenho o contactado pelo id obtido; foreach (var c in contactado) { var contactadoPessoa…
-
6
votes3
answers325
viewsPrevent the system from locking during a batch e-mail
I am developing a system that sends mail in batches to customers, but if the user who is operating the system click on any part of the window during the process, it appears that the system is not…
-
6
votes0
answers151
viewsHow to avoid Paper Feed
Hello, I am using a Engeworks non tax thermal printer to print payment vouchers, I am using the Generic Text Only driver. The problem is that she prints the vouchers as if they were whole pages and…
-
6
votes1
answer469
viewsHow to run a web application on IIS without hosting the source code on the machine?
I have developed a web application (Asp.net, c#, javascript , etc) for a client. The idea is to mature this application, and turn it into a product. The question is, how can I run my web application…
-
6
votes1
answer407
viewsIs it possible to show exception message in en-BR?
I would like my exception message to be shown in English, someone would know how? catch (Exception ex) { Debug.Writeline(ex.Message); }
-
6
votes1
answer1790
viewsDisable dates before the current day in Datetimepicker?
It is possible in the DateTimePicker, disable the days before the current day?
-
6
votes2
answers618
viewsSending model along with uploading files
I have a web API built with ASP.NET Webapi, I have a model that references a file URI (for example representing a photo in a photo gallery, or a product in a catalog) and I need to send the data to…
-
6
votes1
answer1140
viewsSecure Return - Solution
I use C# Asp.Net MVC, I had to make the return of data Secure Pag and I found very flawed the documentation, follows the solution I created below for those who go through the same difficulties.…
-
6
votes1
answer1191
viewsGenerate more than one boleto with the DLL "Boleto.Net"
I noticed that the DLL Boleto.Net has a class BoletoBancario with the property FormatoCarne. However, I can not generate three tickets in the same page. I would like to view a code that makes the…
-
6
votes2
answers174
viewsHow in ASP.NET 5 is this property defined?
In ASP.NET 5 in the method Configure class Startup we can receive in the parameters a reference to an object whose class implements IHostingEnvironment. One of the properties of this class is…
-
6
votes2
answers3494
viewsASP NET MVC Include Url Parameter on all pages
I have an ASP NET MVC application that is multi-client and multi-user, IE, it is prepared to be used by multiple customers and each client can have multiple users. Initially the login form has the…
-
6
votes1
answer166
viewsAdd property in relation to N-N
How to add properties (columns) in an N-N relation using EF? For example, I have the class Produto: public class Produto { [Key] public int ProdutoID { get; set; } public string Descricao { get;…
-
6
votes2
answers513
viewsMonetize Windows Forms C#?
Hello, sorry not to be a question directly linked to a language, but I searched a lot and did not find, anyone knows any library like Ad Mediator to be used in Windows Forms? How do I monetize/place…
-
6
votes1
answer214
viewsSystem.Web.Resources.dll not found
We have a mvc3/dotnet4 project, which consumes DCOM servers (c++) through Intertops. Both DCOM (c++) and mvc3 (c#) servers were compiled with visual studio 2013. The projects were migrated to visual…
-
6
votes4
answers1247
viewsFunction within another
In Javascript, I can structure my code well by placing auxiliary functions inside other functions. For example: I get something similar in C#? If not, how do you not leave the auxiliary functions…
-
6
votes3
answers13362
viewsHow to remove whitespace from a text?
I was trying to get blanks out of a string, but the .Trim() does not work, it displays the white spaces yet: var teste = texto.Trim(); txtConteudo.Text = teste; For example, if he receives: "text ",…
-
6
votes1
answer316
viewsCapture joint position on X,Y,Z axes with Kinect V2
I need to extract the position of the joints from a recording and/or in real time, and convert to database format and/or file (txt). Similar to what is done in this video, but instead of displaying…
-
6
votes1
answer130
viewsTime difference in Linq
I am using Entity Framework, and I have a condition that has not worked very well: .Where(x => ((DateTime.Now - (x.DataInicio.Value == null ? DateTime.Now : x.DataInicio.Value)).TotalMinutes)…
-
6
votes2
answers180
viewsHow to copy a Repeater on the same page
I have a Repeater control with data filled in an aspx page, the same page has the modal, the modal appears when clicking a button. How to reuse the same Reset to list in modal? Repeater:…
-
6
votes2
answers938
viewsHow to join lists in c#?
I have two classes: public class Produto { public int ProCodigo { get; set; } public string ProNome { get; set; } public int DepCodigo { get; set; } public virtual Departamento Departamento { get;…