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
-
3
votes1
answer1373
viewsProblem returning Entity models: "The Entity or Complex type ... cannot be constructed in a LINQ to Entities query"
I’m trying to return a list of objects generated by the Entity Framework Database First but I get this error: The Entity or Complex type 'leaosites04Model.TB_LEMBRETES' cannot be constructed in a…
c# entity-framework linq entity-framework-6 linq-to-entitiesasked 10 years, 3 months ago Reynaldo 141 -
3
votes1
answer133
viewsRSA, Sslstream - Key Exchange
Good people, I am using Sslstream to communicate between a client and server, using OPENSSL. And this client of mine, is a machine (Digi), which as a requirement has to use RSA encryption. Then I…
-
3
votes1
answer987
viewsORA-00911: invalid Character
I’m having trouble with Oracleparameter, I could not find the problem, because I can not see the sql after the assignment of the parameters... follow the code: private DataTable GetSearch() { string…
-
3
votes2
answers243
viewsRegex between words
I’m trying to make an appointment Regex return to me in a source code file statements that are not public %%Enum Tipo, but I’m not very familiar with Regex and I’m having a little trouble, someone…
-
3
votes1
answer224
viewsDirect button click into table item_databound
I have a table inside a Repeater. In this table there is a button. What I want is when I click this button, it triggers the Repeater event: rptGerenciaProcessos_ItemDataBound, just that. How do I do…
-
3
votes1
answer40
viewsWrong webservice message integrating with Actionscript
I’m making an application restful in C#, where I will receive a request via post and return a JSON or a string to the applicant. [HttpPost] public string confirmahora() { String OUTPUT = "mensagem";…
-
3
votes1
answer272
viewsWeb server that receives and sends parameters to C#, is it possible?
I developed a software in C# (.NET) that sends/receives text files to an FTP server, but for security I look to work only with type parameters String/Bytes for security reasons, my question is:…
-
3
votes1
answer1120
viewsModal de Confirmação
I need to create a modal with a warning for the user when they click the save button. I already have a similar one that is used for when the user clicks on 'Delete' that is in my view /Delete <h4…
-
3
votes2
answers77
viewsDoes parameter name size influence http request time?
An http request for a service has its performance (bandwidth consumption/internet/time) changed if the parameter names are large? Example. Requisition POST with the following parameters {…
-
3
votes1
answer1312
viewsDefinition of non-generic method?
In public partial class frmAltInfo : Form Error occurs: Extension method must be defined in a non-generic Static class I don’t understand what it can be or how to fix it. Here was the mistake:…
-
3
votes2
answers206
viewsMessagebox error
I tried to implement the code below in a Windows Phone 8.1 project, the same had already been implemented in Windows Forms successfully. What should I change to be valid for Windowsphone 8.1?…
-
3
votes1
answer106
viewsBitmap array in a single file
I am making an application for Solidwoks and downloaded some examples, in it are used some BMP images as the following view: These images are used as images in menus as follows in C code#:…
-
3
votes1
answer1746
viewsHow to align a string in a 42-character space
I am generating a text file and have to align the company name to the center, but the company name will vary for each customer, the default amount of characters are 42. texto="lb_NomeEmpresa.text";…
-
3
votes2
answers518
viewsHow I debug a method in a Web Service . asmx
I have a call in my application, which goes to a WS and executes a method and returns me. How do I debug the WS?
-
3
votes2
answers352
viewsUnderstanding class instantiation
I have a question and I would like to understand better how class instantiation works. More specifically the most appropriate way to do (if any) and the impacts of doing in the wrong way. Assuming…
c#asked 10 years, 2 months ago Joao Paulo 11,760 -
3
votes1
answer2135
viewsHow to show a notification on the screen without affecting the active application
How do I show a notification without affecting the active application? In short, I want the notification to be displayed on the screen and the active application not to lose focus, or if it is a…
c#asked 9 years, 10 months ago Jonathan Henrique 31 -
3
votes1
answer422
viewsWPF window does not exceed the screen
I have the following code: System.Windows.Point ponto = PointToScreen(Mouse.GetPosition(this)); JanelaAbrir.Left = ponto.X; JanelaAbrir.Top = ponto.Y; JanelaAbrir.ShowDialog(); It opens the Window…
-
3
votes2
answers103
viewsHow to capture Assembly from classes that inherit from a single class
I have numerous classes. All inherit from a single class public abstract class ClasseBase { public int Id {get;set;} } and other classes: public class Teste1 : ClasseBase{ } public class Teste2 :…
-
3
votes2
answers1729
viewsHow to pass values of controls between different windows?
and I’m having a question here about programming in C#, which I’m in doubt of how to do. Well, first I have a program C# of Windows Form Application, in it I created 2 Forms, being the main Form1,…
-
3
votes2
answers212
viewsElectron Configuration of an Element of the Periodic Table
I would like to create a program that makes the electronic distribution of atoms, but I’m not sure how to implement it. Would it be like this? you would put the atomic number and it would return you…
c#asked 10 years, 2 months ago mrlucasrib 641 -
3
votes1
answer988
viewsHow do I remove the character limit of a URL by GET or POST
I have an error sending the form, it returns an error MaxQueryString. Is there any way to increase this number/remove this limitation? because on web.config a high value is already set and it is not…
-
3
votes1
answer3273
viewsOnline SQL database for LOCAL NETWORK only, connect via c#
I developed a system for my company and need a database hosted on our internal network, explaining better I want to host this database on a PC running a Windows Server 2012 here in the company, our…
-
3
votes4
answers3610
viewsReceive an array in the controller from javascript
I am creating an array with a javascript data list: var myArray = gvSortingListagemGARs.keys; Where I have the result: [278, 279, 280, 281, 282] Who are id's of elements of a Devexpress table. Now…
-
3
votes2
answers1107
viewsError returning list with Fluent Nhibernate
Within the Web.API project, I created a Get() method which returns a list of objects - Ilist. This Personal Classaccess has a Log list (1:N). When executing the Get() method, an exception occurs:…
-
3
votes2
answers115
viewsOrderby lambda keeps changing with every search
I have a search in lambda, in which refers information of a grid, but at each different query it changes the information of place: Indicadores = (Pegatodos().Where(f => f.STATUS == "A") .Select(x…
-
3
votes2
answers626
viewsEncrypt ini files
I need a script that Compile a .ini to avoid an easy read. The file should be read with PHP. It seems that C# has a similar feature. The question is how do I do it and then read the .ini with PHP.…
-
3
votes2
answers3318
viewsTake the directory route
I want to take a system directory, open a window and in that window I select a directory. I can select files with the OpenFileDialog but directories do not.
-
3
votes2
answers1423
viewsHow to Put a Word File in Windows Form C#
I am doing a project in college and wanted to make a help system in Word, with the screen image and explain the operation, and within the project create a Help tab and when click on it, open what I…
c#asked 9 years, 9 months ago Denilson Carlos 201 -
3
votes1
answer1957
viewsInclude ZERO before the numbers in CSV file?
I need to include ZERO to complete the digits of the CPF in the csv file, however, if the CPF starts with ZERO is taken out and only the numbers, that is, has Cpf that saves only 9 digits, because…
c#asked 10 years, 2 months ago Ewerton Melo 647 -
3
votes1
answer1368
viewsCustomize calendar C#
In the system I’m doing, I need a calendar that has only the weekends of each month enabled to be selected, the rest is deleted.. How can I do this in C# Winforms? I searched on the Internet and…
-
3
votes1
answer103
viewsConverting an SQL from Sql Server to C#LINQ
I have an sql that looks like this: SELECT coluna1, coluna2, coluna3 FROM ( SELECT coluna1, coluna2, coluna3, ROW_NUMBER() OVER(ORDER BY coluna1, coluna3 desc) as row FROM tabela1 WHERE coluna4 in…
-
3
votes2
answers190
viewsCode abstraction
I am creating a project of questions and answers, more to consolidate my knowledge and acquire others. But when developing it I arrived at a question that I am thinking about which of the options…
-
3
votes1
answer935
viewsDatabase query for a C#List
I need to make a query at the bank, I made this code for connection, but I do not know how to proceed to put this information in a list<String> SqlConnection conexao = new…
-
3
votes3
answers1909
viewsTry/catch does not show correct message
Guys, I have a C# code that has the code: Uri resultadoURL; bool resultado = Uri.TryCreate(Configuracoes.Configuracao.URL, UriKind.Absolute, out resultadoURL) && resultadoURL.Scheme ==…
-
3
votes3
answers727
viewsDoes complex code interfere with application performance?
I have a somewhat legacy C# web application, which works on my client, but it’s been about 3 years. At the time, I programmed as I learned in college and did not know the concept of clean code. It…
-
3
votes3
answers12809
viewsError while running my MVC application
That is the mistake: Linha 1: <%@ Application Codebehind="Global.asax.cs" Inherits="Util.MvcApplication" Language="C#" %> I had created another project called Util and started to give this…
-
3
votes2
answers393
viewsLoad Only part of the Site by clicking Actionlink
I own the following ActionLink in my MasterPage. <div class="areaRetangulo"> <div class="col-lg-3 vermelho retanguloTamanho primeiraImagem"> <div class="triangulo…
-
3
votes1
answer793
viewsLambda Linq Problem: LINQ to Entities does not recognize... get_Item(Int32). How to resolve?
When trying to execute the loop for (time when query is executed) is giving error in my lambda expression: var funcionarios = repository.Funcionarios .Include(x => x.Cargo) .Include(x =>…
-
3
votes1
answer328
viewsReturn Join Linq C#
I’m trying to return a Join to my class and it’s giving me the following error Error 1 Cannot implicitly convert type System.Collections.Generic.List in 'System.Collections.Generic.List' C:…
-
3
votes1
answer331
viewsAdd Textbox inside an HTML table with Jquery
I have the Jquery Script below that searches a Material and returns a Json list of that materials, I need to put this data in a table and put a field for the user to enter the amount of these…
-
3
votes1
answer226
viewsWhy are relationships in the Entity Framework code first pointed with Icollection<T>?
Why are relationships in the Entity Framework code first pointed to with Icollection? What is the best instantiation(?) for the property in common cases? List? Using the virtual keyword is only to…
-
3
votes3
answers205
viewsProblems with logic (&& or ||)
I found strange the code that is in my system: if (cmbCdTipoProcesso.SelectedValue != "3" && cmbCdTipoProcesso.SelectedValue != "4") {....} Apparently the code is weird, 'cause I’ll never…
-
3
votes1
answer100
viewsDynamic image and SEO behavior system
I did a reading on SEO and understood that the higher the text traffic, you have more content to be indexed by Google. I have an application that is based on images, is practically a…
-
3
votes1
answer164
viewsUsing Sendmessage with applications like Notepad, Word, Dreamweaver
I’m having a hard time working with SendMessage(), in some programs works from one method and with others from another... To write on Notepad, I do the following: [DllImport("user32.dll")] public…
c#asked 10 years, 1 month ago user3062055 71 -
3
votes1
answer1711
viewsHow to open a . Net dll
I arrived at the company and already got a program in progress and the previous developer left the company. The program is well done. The executions of procedures and tables are within a dll and I…
-
3
votes1
answer205
viewsAsynchronous server responses for AJAX calls
I have an application that at the end of a page loading I make an AJAX request that takes around 20 seconds. After this request my page keeps working normally so that when I try to make another AJAX…
-
3
votes2
answers275
viewsMount html by c#
I believe you have a better way of doing this, because when I did it made perfect sense now I don’t mean anything else, so it gets very confusing: I have A field in the table that stores the…
-
3
votes1
answer274
viewsHow to develop an asynchronous mechanism to test pings?
I have a problem of slowness in a transaction that usually performs pings to check if certain IP’s are accessible. It turns out that this transaction tests more than 20 different IP’s, which makes…
-
3
votes2
answers486
viewsAsp.net mvc Bad Request
When using the class HttpStatusCodeResult as a return to a Action, how do I redirect the user to a custom page according to the error?
-
3
votes3
answers831
viewsTempdata["Message"] error in Runtime saying the object is null
I started recently with ASP.NET MVC, and as you can see I’m playing in the if instruction, tempData[] and what happens is a following, every time I click inside Else in "View in Page Inspector" it…