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
votes1
answer719
viewsAjax Receive String List from a Webmethod
I need to pass a string list of a server method to ajax, but it doesn’t work. If I just pass a string it works. Follows the code: [System.Web.Services.WebMethod] public List<string>…
-
2
votes1
answer360
viewsHow to observe user inactivity and enable or disable the lock screen on Windows Phone 8.1
How do I turn off automatic screen lock on windows phone 8.1 ? phoneService.UserIdleDetectionMode = IdleDetectionMode.Disabled; Before the use of the line above met, but the same is no longer valid…
-
2
votes1
answer157
viewsCreate a record and add relationship through the httpPost Web Api
When creating a new record in the tab I need to take the ID of my main screen and send along with the new object. Currently I have this code: public async Task<IHttpActionResult>…
-
2
votes3
answers589
viewsException in reading XML file
I’ve been trying to fix this error in reading XML for weeks. I’m creating an app for Windows Phone 8 in C#. The moment I click on a subject and present the page with a listbox. An Exception of type…
-
2
votes3
answers679
viewsError generating PDF with Rotary
Guys, I’m having a problem here to generate a pdf with the data coming from the bank. My system has a register of students and their occurrences. What I wanted was that, at the time of detailing the…
-
2
votes1
answer475
viewsASP.NET Identity customize on its own basis
I already have my base ready with the login table, and I didn’t want to change it, so I wonder if it has how to customize it with the tables I already have! and how to do this! Below the mapping of…
-
2
votes2
answers72
viewsExpression does not bring results, but there is data
This is my direct sql query. select c.de_cnpj, c.DT_TransacaoV from T_CRM_StatusPDV c join T_PDV p on c.DE_CNPJ = p.CNPJ where DATEDIFF(DAY,c.DT_TransacaoV,GETDATE()) > 45 This is my lambda…
-
2
votes2
answers1797
viewsDevelop for iOS using C# in Visual Studio
I already develop in Java/Android, and wanted to develop for iOS, but the cost of having a Mac is expensive, I already have an iPhone. I saw that it was possible to develop using C# in Visual Studio…
-
2
votes2
answers5178
viewsPlace a red Gridview line if a cell has the false value
I would like a certain line from my GridView turn red if the corresponding cell in the closed column is false. My Asp.Net is like this: div class="GridMain"> <asp:GridView…
-
2
votes1
answer149
viewsRemove C# Webbrowser Details Print
Just like in the image, I need to remove these details in the corner of the page and put a description in the bottom corner of the page will be possible? I’m making an impression like this:…
c#asked 10 years, 1 month ago user3434888 129 -
2
votes1
answer69
viewsMultiple threads can interfere with timerControl
I am developing a program that contains more than 10 threads running ... has emerged the need to have two timers, one to block and the other to release a process, so I am using Winforms timerControl…
-
2
votes1
answer167
viewsHow to position a text inclined in Reportviewer?
There is a way to tilt a word (textbox, or other possible way), in Reportviewer, to stay at 45º (degrees), for example?
-
2
votes1
answer147
viewsReset View object list even with Hiddenfield
public ComprasOrdemCompras GetToCreate(ComprasOrdemCompras model, int EmpresaId) { ComprasOrdemComprasProduto clsPedidoProduto = new ComprasOrdemComprasProduto(); //Preenchi meu produto INÍCIO //…
-
2
votes1
answer116
viewsPlace a decision control inside a lambda expression
I’m building this consultation: private List<string> pegaInformacaoParceiro(string _osparceiro, string _cnpj) { List<string> lista = new List<string>(); WEBEntities db = new…
-
2
votes1
answer980
viewsC# creating a property in a Usercontrol
I have a project in C# and created a usercontrol with two components: a combobox and a button. I need to create a property to change the properties of the usercontrol combobox. I tried it this way:…
-
2
votes2
answers510
viewsOptimize operation with lambda
I have the following classes: public class Pedidos_Itens { public int ID { get; set; } public int Qtde { get; set; } public Pedidos _Pedido { get; set; } public int Pedido { get; set; } public…
-
2
votes2
answers1246
viewsPop-up Child window
I have the following button that basically inserts data from a web form, but that button is on a pop-up. What I intend is that when you run the button, after entering the data close the window of…
-
2
votes1
answer140
viewsValidate delete in controller, return html helper
I have my registration, which was done using Scallfold’s visual studio In my view: @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="form-actions no-color"> <input…
-
2
votes1
answer790
viewsOpen a folder on the user’s machine and open a file (csv,txt or xls)
How do I open a folder on the user’s machine? I need to open the folder and upload a csv, txt or xls file. I use MVC5 That would be about it. A button that clicks in the folder and then I click that…
-
2
votes2
answers3544
viewsCalling a jquery function when changing tabs
I have a jquery function that mounts an html. It turns out there is a View with 4 tabs. When selecting a particular tab, the function is called and of course, load the dynamic html to assemble the…
-
2
votes2
answers264
viewsHow to instantiate a class with abstract methods in C#
In java we can implement abstract methods by instantiating a certain class Thread threadA = new Thread(new Runnable(){ public void run(){ for(int i =0; i<2; i++){ System.out.println("This is…
-
2
votes1
answer659
viewsShow null results through LEFT JOIN with Linq!
I have an SQL query: SELECT A.Codplano, A.Secao, A.Setor,A.Subsetor,A.Contato, ISNULL(B.Subord,'NÃO LANÇADA')AS Situacao FROM vwPLANODIN A LEFT JOIN LANCADA B ON A.Codplano = B.Subord and B.Data =…
-
2
votes1
answer74
viewsFailure to popular a gridView
I am having problems when displaying a gridView, it is not displaying the right data, it seems that this trying to display vertically, I have already changed the property Gridline to horizontal,…
-
2
votes2
answers165
viewsHow to use Referenceequals, Equals, Gettype, Compareto, Gettypecode?
I would like to know how to use and what the methods are for ReferenceEquals, Equals, GetType, CompareTo, GetTypeCode.
c#asked 10 years, 1 month ago Raffa Ferreira 479 -
2
votes2
answers1776
viewsAccessviolationexception - Read or write attempt in protected memory
I’m working with the OPENCVSHARP (Opencv) to access a camera Ps3eye (Playstation 3) camera in C#. But I am having a serious problem with protected memory! I use visual studio 2010 on Windows7. Code:…
-
2
votes1
answer321
viewsControlling to prevent window from opening again in Mdiform
How do I check if a window has been opened? If it has been opened, bring it forward, otherwise open a new window. That is, I need to control the windows, checking them so that only one is open.…
-
2
votes1
answer324
viewsEntityexception when connecting to remote database
When connecting to the local bank, the application works 100%. However, when I try to connect to sql server remotely (on a redehost server), the application raises the following Exception: Below is…
-
2
votes1
answer1122
viewsMake an SQL query with Entity Framework 4
How do I perform a query in the database using Entity Framework 4 passing a string previously stored inside a StringBuilder. The reason is that the SQL query string is giant. I know it is not a good…
-
2
votes1
answer652
viewsRsacryptoserviceprovider - Decrypt
Using RSA encryption, I pass the encrypted data from client to the server decrypt. When trying to decrypt, it returns an exception CryptographicException with the message: Specified invalid flags. I…
-
2
votes2
answers273
viewsClass that selects the product name or code or value
I am making a class that will receive one of the three values, and will list the field I fill in, I will enter the product name or the code or the value and will list me. I need help to make the…
c#asked 10 years, 3 months ago anderson seibert 569 -
2
votes1
answer1214
viewsPermissions of users
I do not know how I can be implementing in my systems the permissions of users and I would like you to give me some north. From my own class: public class Loja_Usuarios { public int ID { get; set; }…
-
2
votes1
answer789
viewsWhich aspect-oriented programming frameworks exist for . NET?
Researching about aspect-oriented programming, found a framework that implements this paradigm, the Postsharp. But this tool is paid for some Ports. Does anyone know any more?…
-
2
votes1
answer490
viewsHow do I get an Annotation date, to be able to access value from another property?
I have my following properties: public ETipoPessoa TipoPessoa {get;set;} public string CnpjCPF {get;set;} public enum ETipoPessoa { Fisica, Juridica } I have this condition, if Type = Physical, I…
-
2
votes1
answer924
viewsAccess login protected page with C#
I need to make a script to capture links from a page, it happens that this page is protected by login, I have this login but I do not know how to make a request to access this protected page. It…
c#asked 10 years ago Vinicius D. Borba 21 -
2
votes2
answers2135
viewsProblems installing a service on Windows Server
I developed an application in Windows Service, in Visual Studio; I cannot install the service on Windows Server; I made a suggested change and also not registering, occurring the following problem:…
c#asked 10 years ago Gustavo Castilho 392 -
2
votes1
answer1223
viewsComplex query when passing parameters
I need to make a query, but I’m having a hard time. I have 5 filters on the page. Three of them come from three dropdown (select). I can only consider select if the text in them is different from…
-
2
votes0
answers739
viewsIdentify phone number
I need a C# code that identifies calls from the phone. Example: type Bina. I don’t know what kind of device I have to use. I did a research, it seems that has even in USB, but I have no idea how to…
c#asked 10 years ago Carlos Mansilha 105 -
2
votes1
answer72
viewsLocal Bank Storage Method
I have a local bank on my desktop, in it I developed an application using C# and Asp.Net MVC and thought it would only take the trouble to migrate to some MS SQL database when uploading the project.…
-
2
votes1
answer1902
viewsIs it possible to get a specific line of txt/csv file using an address?
It is possible to access a line from a file txt/csv (example below) by your address directly without having to go through each line using C#?…
-
2
votes2
answers1198
viewsGet network path
I have a Form that is saved on the network that is mapped as \\\\BRJGS090\suporte$ in the unit Z:. This Form runs an application that is in the same folder through the ProcessStartInfo, on the local…
-
2
votes1
answer256
viewsGet Organization/Departament and Organization/Title with Userprincipal - AD and C#
I am using the reference System.DirectoryServices.Accountmanagement and I have the code below: string dnsAD = "USINA.REDE"; string groupName = "Grupo Controle Acesso Gestao de Ativos"; //seta o…
-
2
votes1
answer141
viewsUsing Ipagedlist with multiple results
I am using Ipagedlist to list results in my application. But I’m trying to solve a problem: When I get a lot of results, going to the controller function to read the results from another page gets…
-
2
votes1
answer286
viewsChange DIV style according to FORM
I have the following application to login public ActionResult Logar(String Login, String Senha) { var bdUsuario = ClientesAplicacaoConstrutor.ClientesAplicacaoEF(); var usuario =…
-
2
votes2
answers608
viewsUse of the Ienumerable
I saw an example in another post about the use of IEnumerable var ent = new EntFuncionarios(); IEnumerable<Funcionario> funcionario = ent.Funcionarios; IEnumerable<Funcionario> temp =…
-
2
votes1
answer383
viewsSerialization - Webapi for WCF with base type property (Abstract)
I have a problem here where I have a Webapi consuming a WCF. I’m basically having trouble getting into WCF a property that’s the base type of class I’m actually sending. I’ll set an example to make…
-
2
votes0
answers208
viewsHow to set parameters in a Crystal report
For example: I want to generate an employee report that I select, and in the report this generating only the employee registration 1, independent of the selected employee.…
-
2
votes1
answer187
viewsButton is triggered even disabled, what to do?
I have a linkButton that is disabled via server, so: lkExcluir.Enabled = false; Code: <asp:LinkButton ID="lkExcluir" runat="server" Text="[Excluir]" Font-Bold="true" OnClick="lkExcluir_Click"…
-
2
votes1
answer109
viewsImage in C# Windows Forms
I’m doing a new project using C# windows Forms, and I needed to open an image and rotate it only horizontally. I looked for some examples on the Internet, but I couldn’t find one that was clear.…
-
2
votes0
answers330
viewsBlock termination of android app
I’m developing a managerial application for Android, using C# with Xamarin. There is some way to block the application (or lock all the buttons on the tablet) so that the user can not close it,…
-
2
votes2
answers1608
viewsSimulate a Click on Webbrowser using C#
I would like to know how to perform a click on a button of an internet site even by clicking on such web element debugged in the browser itself. I’m using the webbrowser component of C# I have tried…