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
-
1
votes1
answer418
viewsWrite a Cód to the magnetic probe
I have a printer Evolis Dualys 3 that has the option to record a Cód in the card magnetic Arja, by third party software the recording was successfully performed, now I would like to make this…
-
1
votes1
answer49
viewsHow to stop a pivot when the Holding event is triggered?
I’m hoping that when the event Holding is fired, I can block the movement of my pivot. I’ve tried using the properties IsEnable and IsHitTestVisible, however I can still accomplish the Swipe during…
-
1
votes1
answer146
viewsFilter search with Checkbox values
For example, the User typed the title of a publication, and marked the generous Action and Adventure, or the user did not type any title, but wants to see all publications that fit these genres. How…
-
1
votes3
answers661
viewsHow to make the text disappear from the WPF C#field
I’m using wpf for the first time, as is the declaration of a textbox field in which I have a text (Ex: "Login") and when I click it disappear and soh the pointer so I start typing? If you don’t…
-
1
votes1
answer467
viewsIdentify via Windows Forms C# the URL the user accesses
I have a LAN House and would like to do a search with graphics on the websites that my clients access. To do this, I need a way to capture the URL’s they type in the browser through a Windows Forms…
-
1
votes1
answer4974
viewsImplementation of ASP.NET MVC Shopping Cart
I am trying to set up a "simple" selling system, but I have no knowledge in e-commerce. What I want is the following: The user chooses the products he wants, assembles a cart, and finalizes the…
-
1
votes1
answer1316
viewsConsuming Protheus webservice in C# (array)
I have two webservices developed in Protheus(TOTVS) that will be consumed in my C# application in VS2013(Windows form). The first always returns a string and is working perfectly, the second returns…
-
1
votes2
answers2131
viewsSearch between two dates in my database
I was wondering if you could help me solve a problem that I’m having some difficulty solving. The problem is this: I have a database with a table of values in which I store: date: datetime value:…
-
1
votes1
answer968
viewsHow to capture file size from System.Drawing.Image?
I have a method to which I pass the parameter System.Drawing.Image and the percentage that this image will get after the resize. public static Image ResizeImagem(Image imgFoto, int percentual) {…
-
1
votes1
answer38
viewsImport or add Folder from an old project
I did a project and it was a problem in Solution. I had to create a new project and now I’m adding the old files. What happens that when I import folders it does not matter, only files. So far it is…
-
1
votes1
answer757
viewsHow to access Json object property?
I am receiving via Ajax a Json object, and would like to turn it into a C# object and access its properties. How can I do that? I ended up reversing the name of the variables (objeto, itens), the…
-
1
votes1
answer792
viewsHow to add item in an order in Asp.net c#?
I am developing a project that asks that items from a pizzeria be added to an order, not being a shopping cart, generating the order as if it were a cashier program. I don’t know how to add items to…
-
1
votes1
answer233
viewsSQL does not keep new recordings
I’m using a Service-based Database (.MDF) to save some data from an application I’m developing. However, after I close the application, the data that was entered in the table disappears. It follows…
-
1
votes1
answer218
viewsElement <Strong> returning empty - Htmlagilitypack
I’m trying to get the contents of an Strong text from the submarine site. When I open the website with browser I can see in the code the content however, using Htmlagilitypack the content returns…
-
1
votes1
answer656
viewsImage of the database in reportviewer
Hello, I have the following problem: I have a table of Paciente and in it has a field Foto, which is a string with the path of this photo. I need to generate a report with the data of the selected…
-
1
votes0
answers105
viewsHow to get a Textbox from an Accordion that has been dynamically generated?
It follows the code of how I create the Accordion private void CarregaAccordionCarros() { //DataTable da Consulta var dtTable = GetDataCarro(); AjaxControlToolkit.AccordionPane AccordionPane = null;…
-
1
votes0
answers35
viewsCross-Platform Visual Studio 2012 C# | Android
Is there any solution outside Xamarin to develop in C# Android applications? Accessing features like GPS that we can trust and develop business applications?
-
1
votes0
answers859
viewsError of multiple redirects
Before I didn’t make that mistake when I killed the session. The mistake is this: How do I fix. Esta página da web tem um loop de redirecionamento RecarregarOcultar detalhes A página da web em…
-
1
votes1
answer60
viewsProblem with Jquery function
The function I created in Jquery, is not being called in the 1st click, it is only triggered in the 2nd. I am using Asp.net, C#, I need the panel component to start hidden, with this, when clicking…
-
1
votes1
answer302
viewsHow to create variables for the status of an order?
How can I create variables to serve as possible order status? After the order already made, I want to create options so that when the attendant type, the order status is changed. The options can be:…
-
1
votes1
answer248
viewsDesign standard or best practices for handling virtual disk files
There are standard or best practices for dealing with upload, storage, file publishing, and access control? Environmental example: I have a system that will need to register Calls and News and in…
-
1
votes1
answer541
viewsCheck if file is newer and then download
I created a windows service, which daily downloads some files. These files have about 2Gb (that’s right, two gigabytes!). The problem is that these files are every day available on the site, but are…
c# filing-cabinet http-request webrequestasked 9 years, 10 months ago Guilherme de Jesus Santos 6,566 -
1
votes0
answers39
viewsCompiler "Roslyn" already available in Codedom?
I wonder if the Microsoft Roslyn Compiler is already available in namespace System.CodeDom do. NET Framework... If not, how do I reference this compiler in my project?
-
1
votes1
answer756
viewsFill foreign key with primary key value
I am doing an application with ASP.Net MVC and Nhibernate, I have a company registration and a customer registration, where a company can have several clients. The classes are already mapped to the…
-
1
votes3
answers220
viewsReturn in a view-specific div
I have a view where the contact form is at the bottom of the page, with validation via Dataannotations. When I click the send button, the controller checks the Modelstate, if it is not valid, it…
-
1
votes1
answer149
viewscustomize Roleprovider without using Membership or ASP.NET Identit
Good morning. My doubt and the following I have the authentication part of my system made without using Membership or ASP.NET Identit. and wanted to make or use the method [Authorize] already picked…
-
1
votes1
answer133
viewsAdd parameters to Idbcommand
I used the method below to add parameters using the interface IDbCommand using System; using System.Collections.Generic; using System.Linq; using System.Text; using EstudoDotNet.Comum.Dominio; using…
-
1
votes1
answer160
viewsChange label text while running a loop on the server
I have a screen that does a lengthy processing, and there’s a for that each next, I want to set a label for the user to see the process. I know it can be done by ajax, but I haven’t found anything…
-
1
votes1
answer1332
viewsHow to Reference a DLL using <Dllimport> and a variable in the path?
I’m having a problem at the moment of referencing a dll using the <DllImport>, because in the place where I put the dll path <DllImport("C:\MinhaDll.dll")>, i would like to use a…
-
1
votes0
answers117
viewsDisable sound browser?
Good afternoon guys. I am developing a browser in c# and it has an off button áudio. This button would more specifically disable any audio that touches the browser like watching videos from youtube…
-
1
votes1
answer86
viewsInstruction throw is making the system inconsistent
I have a Try.. catch and catch the fellow who did let only throw. catch(){throw;} Well, my intention is to treat all that exceptions and not just let throw. But since I just got here at the company,…
-
1
votes1
answer108
viewsSQL database for multiple users
Well, I have a question. I am developing a web application that will suit more than one user, however each user has different data recorded in the database, and this volume will be great, since the…
-
1
votes1
answer2499
viewsHow to call controller action?
I have the following code: function confirmaExclusao() { var decisao = confirm("Deseja excluir permanentemente esse item?"); if(decisao == true) { //Chamar a action para excluir } else { //Aqui não…
-
1
votes1
answer504
viewsCount and access checkbox marked
I need to count checkboxes that are marked on a panel and are horizontal. It’s Windows form, C#. I couldn’t format a listbox to the horizontal, so it’s in a panel. But I’d like to count them and…
-
1
votes1
answer360
viewsHow do I store values as objects in Web Forms?
How can I store the values of my class? Every time I click the buttons my class seems to be instantiated again. My class: public class Partida { public string[] linha1 = new string[3]; public…
-
1
votes1
answer142
viewsHow to use Scope_identify to return id . NET
I am developing an application and need that when sql does the Insert return the value of the id that was inserted, I am using the following command SqlCommand cmd = new SqlCommand("insert into…
-
1
votes1
answer165
viewsError trying to generate PDF file with the same name
When trying to generate PDF files, I often come across as the error: Mensage: The process cannot access the file’D:.... 23381708.pdf' because it is being used by Another process. Which tells me that…
-
1
votes0
answers90
views@HTML.Checkboxfor does not pass value to the model
I have the following problem: I have a checkbox on the page but even marking it, on controller the Model continues with the field lavagem = false. Model public bool lavagem { get; set; } View…
-
1
votes1
answer64
viewsProblem to the popular Datagrid
I’m making the population of a Datagrid, but I don’t know why you’re not showing. Result: Only empty lines are returned. Fiscalizacao.Cs public class Fiscalizacoes { private String Concessionaria {…
-
1
votes1
answer161
viewsValidation control Errormessage
I got the following model: public class Request : IEntity { public int Id { get; set; } [Required(ErrorMessage = "O Centro de Responsabilidade é obrigatório!")] public string Cadastro_Id { get; set;…
-
1
votes1
answer1503
viewsHow to open bytes of pdf in a new browser tab
I have the bytes of a report in pdf but only found how to download. byte[] bytes = Relatorio.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);…
-
1
votes1
answer361
viewsModifying Values of Multiple Lines
I need a query that modifies several values at the same time That’s kind of the idea "INSERT INTO registros(Envio) VALUES('1') where Aviso = '" + DdataAtual.Year + "-" + DdataAtual.Month + "-" +…
-
1
votes1
answer89
viewsAccess memory region that has already been displaced
I am in the final process of developing a program and I came across an error, I already spent some time researching and I could not solve the problem. About the program: In summary, the program…
-
1
votes1
answer1435
viewsSave Request - ASP.NET MVC
I want to make a simple Ecommerce on my website based on this question: Implementation of ASP.NET MVC Shopping Cart However, I am doubtful when it comes to doing two things: 1º Save the data in the…
-
1
votes1
answer191
viewsViolation of multiple restriction
Someone has already come across this error in an Asp.net mvc application? Server Error in Application '/'. There was a restriction violation of multiplicity of relation: an Entityreference may not…
-
1
votes2
answers946
viewsHow to resize images before upload using c#Asp.net
I am learning. net mvc 4 and would like to know if there is any good and simple library, to resize images before uploading, I googled and only found complex functions with resizing calculations made…
-
1
votes2
answers92
viewsHow to make a method to write to the variable in which it extends?
I had an idea to apply in loops and wanted to make a method bool.toogle() where the variable extends the same value will receive the opposite value. Something like this: bool variavel = true;…
-
1
votes0
answers446
viewsLayout does not appear when program runs
I’m testing a code and I put a button and a picture box in the windows form however, when I will perform is not shown the button and picture box I placed. I checked and the property Visible is as…
-
1
votes1
answer99
viewsCode First One to Many
My setting: public class AlunoAvaliacao { public int AlunoAvaliacaoID { get; set; } public DateTime Inicio { get; set; } public DateTime? Fim { get; set; } public virtual int AvaliacaoID { get; set;…
-
1
votes1
answer116
viewsC# method for checking a string
Guys, someone there could give me a boost, help create this method in C#? Method to check parentheses in a input. For example, the method should return verdadeiro for the following values: ((5+2)*2)…