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
votes2
answers279
viewsSet name property anonymous object and Resources
I am using Resources for multi-language on a system. In a return json I create an anonymous object var resultado = minhalista.Select(x => new { }) But it turns out that I need the property of…
-
1
votes1
answer805
viewsPopular Dropdownlist and make Insert with the chosen value
In my DB I have 3 tables: - Genero(IdGenero,Genero,Descricao) - Publicação(IdPublicacao, Titulo, Sinopse,IdUsuario) - PublicaçãoGenero(IdPublicacaoGenero,IdPublicacao,IdGenero) This last one makes…
-
1
votes1
answer4703
viewsConversion is not valid
public int ObterTotalAcessos() { int obtertotal = 0; using (var connection = ServiceLocator.ObterConexao()) { var command = connection.CreateCommand(); command.CommandText = "SELECT SUM (ACESSOS)…
-
1
votes1
answer804
viewsInclude Problem in Entity Framework
I have the classes: public class Estado { public int Id { get; set; } public string Nome { get; set; } public string Uf{ get; set; } public ICollection<Cidade> Cidade { get; set; } } public…
-
1
votes1
answer444
viewsHow to get resolution of an image?
How do I get image resolution? I have a web application and I need to get this data from an image on the localhost.
c#asked 9 years, 6 months ago Leandro Belo 113 -
1
votes1
answer59
viewsQuery with LINQ, trying to perform a RIGHT JOIN
I need to make the following query through LINQ, using the informed tables: Must return all vehicles where the "Type" has the field "PART" equal to "true", the link of the table "Vehicle" with the…
-
1
votes0
answers31
viewsHow to add a file to a Changelist
I want to add files to the "ignore-on-commit" changelist. I have this code, which runs, not the error. (But it also doesn’t work :v) using(SvnClient client = new SvnClient()) { string sSoluctionDir…
c#asked 9 years, 5 months ago João Paulo Pulga 431 -
1
votes1
answer70
viewsAutofac. Dispose or not
There is a difference in performance or best practice between the two examples? Example1: private void Teste() { using (var scope = Container.BeginLifetimeScope()) {…
-
1
votes1
answer47
viewsIs it feasible to use datatable copyBulk for DBMS data loading?
I went through an experience in doing a large load of data from a text file, which needed to be criticized before writing to BD. I used Datatable with copybulk. I realized that the data load in…
-
1
votes1
answer358
viewsHow to get the value of the date field?
I have a method that returns database values in my screen components. It takes as parameter 3 string and 2 DateTime protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) {…
-
1
votes1
answer233
viewsError loading Library Monodevelop
I am trying to use the Newtonsoft.Json library in mono, but I get the following error: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0,…
-
1
votes1
answer470
viewsRadio button using Viewdata for a MVC model
I own a Viewdata and would like to turn it into a Radiobutton for a model ViewData["tiposPagamento"] = dbo.TiposPagamento.Where(_=>_.Ativo); Radio Button :…
-
1
votes1
answer32
viewsError using Rsaprotectedconfigurationprovider
I am making an example using Rsaprotectedconfigurationprovider and I generated an error, I am unable to solve the problem. NOTE: correction, the error was solved, I had forgotten a detail, now if…
-
1
votes1
answer238
viewsProcedure with out parameter (SYSREFCURSOR) with Entity Framework
I am having a problem that is keeping me awake. I am making a database migration, from SQL Server to Oracle, in a C#application. The application mentioned is using Entity Framework to perform…
-
1
votes1
answer133
viewsComponent to replace Gridview
I’m having a lot of problems with Gridview in Asp.Net that are taking me seriously, especially the paging and exporting part of the data. Is there any other free component on the market, which…
-
1
votes1
answer531
viewsDropdownlist and Listbox - Recovering Values in Editing
In a CMS I own a DropDownList and a ListBox that work regularly in the field of registration, however, do not bring values in the field of editing. View <div> Tipo de Curso<br />…
-
1
votes1
answer466
viewsCapture of Print Event
Good afternoon, I would like to know how to capture the print event using c#. Example: the user clicks on the print option of the application he is using (Word, outlook etc...) and instead of…
c#asked 9 years, 5 months ago Miguel Pacifico 41 -
1
votes1
answer275
viewsHow to maintain a Session after re-running an application?
In my MVC 5 project, a session with the user data is created in the login and after the re-execution of the application the Session no longer exists, however, the authentication Coockie still…
-
1
votes2
answers262
viewsWhat is the difference between authorizecore and onauthorization
When will we create an attribute like AuthorizeAttribute We have these 2 properties to be overwritten What is the difference between the two? Both seem to have the same function [Edit] The namespace…
-
1
votes2
answers338
viewsASPNET Application does not send emails
I have an application that has a screen with sending emails, This application works 100% on a virtual server (MANWEB10), including sending emails. When exporting to this new server (MANWEB01) the…
-
1
votes3
answers2501
viewsBuild problem in C#release mode
While trying to build release mode displays the following error message: Mixed mode Assembly has been compiled relative to 'v2.0.50727' version of runtime and cannot be loaded at runtime 4.0 without…
-
1
votes1
answer1395
viewsEntityframework type conversion error: Cannot convert a 'System.Collections.Generic.Hashset`1[]' object
I am getting this error while trying to record a new record of Atendimento. Cannot convert an object of type 'System.Collections.Generic.Hashset`1[Domain.Servicesinexus]' in type…
-
1
votes2
answers1301
viewsHow to Save and Recover All Sessions of a User
I am developing a system in which I need to recover all users logged in or with active session on the server. Context: When the user logs into the system, in addition to creating the Session, save…
-
1
votes1
answer450
viewsBlock if you just type a word into a Textbox
I work with C# - WPF and have a field where the client can enter his full name. I’d like to validate where it can’t just type the first name if it doesn’t open a blocking message. I mean, he would…
-
1
votes1
answer9353
viewsORA-12154 TNS: could not resolve the connect Identifier specified
I’m having trouble when an application tries to connect with the database, I get error ORA-12154 TNS: could not resolve the connect Identifier specified. When I give a tnsping or try to connect by…
-
1
votes1
answer7307
viewsCheck items from a list in another list
I’m having trouble making a method to check two lists. This method will receive a list which is the list that has been added to the order and the Purchase Order Id to which that order has been…
-
1
votes0
answers341
viewsUnity 5: How to make the game go back exactly where it had ended in its last run?
Example: the guy was playing and in the middle of the stage he closed the game, hence how to make so that when he opens the game again he goes back exactly in the part (or phase) that he had been…
-
1
votes0
answers205
viewsCreate auto-update phase menu in Unity 5?
Example: At the beginning of the game the menu will only have the Level 1 button, once the guy passes the level how to create an automatic button for level 2 in this menu? This button will redirect…
-
1
votes3
answers5685
viewsHow do I open a file from a specific directory in . PDF in Visual Basic 6?
I created an application which saves files in a specific directory. What I would like is to click a button, I can open this file . pdf.
-
1
votes1
answer533
viewsHow to make a lambda in?
I have a function convertStringListaInt parameter String. Example : String: 1,2. I’m converting this string into a List of the kind convertStringListaInt_Result owned by number(whole). How can I…
-
1
votes2
answers269
viewsCould not resolve this Reference. Could not locate the Assembly "Mysql.Data"
How do I add the "Mysql.Data" Reference? I am using Sharpdevelop and not Visual Studio!!
-
1
votes1
answer144
viewsRecovering badly formatted string when it contains accented words
In my application I am having trouble fetching the data in the Postgresql database, the words with accentuations when retrieved from the database and dealing in DataReader are coming badly formatted…
-
1
votes1
answer75
viewsError adding While value in List<>
I’m trying to add the value of a result of mine while, and then carry it on my GridView. But I’m having a problem adding value to mine List<>. Does not accept adding prob1.vTotal in lstTotal.…
-
1
votes1
answer80
viewsAccess denied when obtaining namespace connection time
I am developing an application for the Windows Phone and I’m wearing a namespace who makes the connection. The problem is that this namespace says that it has no access to the appeal, and that the…
-
1
votes1
answer557
viewsReturn to previous view with data filled in
I have 3 View’s, a main (Index) containing fields to perform filters and a search button, another ,Gridindex (rendered inside the Index view), where records are demonstrated based on search filters,…
-
1
votes0
answers26
viewsSplit accesses between the new site and the old one
I’m going to publish a new site and I wanted only a few hits to it so I can evaluate its operation and the other hits will be forwarded to the current site. Facebook does something similar when it…
-
1
votes1
answer112
viewsPrint matrices with line break
I want to print the various variables of a List. I’m trying to use foreach but it hasn’t worked. Variables are written over each other instead of a line break. Look at my code in the event…
-
1
votes1
answer6384
viewsAdding values present in a List
I’ll explain what I want to do. I have this List: public static List<Cliente> Clientes = new List<Cliente>(); public class Cliente { public string Nome { get; set; } public…
-
1
votes1
answer302
viewsInsert tab when printing
I have a code to print each variable of a List. I am trying to insert a tab into these variables. Take a look at my code that is in the event printPage: int charactersOnPage = 0; int linesPerPage =…
-
1
votes1
answer369
viewsGrab project URL
Hello, I need to get the url where my project is (wpf). The reason is this: there is an image upload inside the Image folder (which is in the Image File of my project) and I need the image File to…
-
1
votes1
answer86
viewsCluster application
I have to do a C# application in cluster, what happens is I don’t know what to do. It’s a simple application. Does anyone have any example of such an application that can make me available?
c#asked 9 years, 4 months ago Onnezimo Barbosa 11 -
1
votes1
answer586
viewsPostcode in c#
Does anyone know how to get all the zip codes from Portugal to use in a c#program? I’ve tried to look, but I can’t find anything concrete, so is there anyone who can help me? Thank you
-
1
votes1
answer2031
viewsHow to list all files from a server directory in ASP.NET MVC?
I want to know how to create a List<string> with the filenames of a given directory. The service is hosted on a shared server, published in my httpdocs. I have several images inside…
-
1
votes0
answers108
viewsHow do I pull sellers in a combobox to then filter the sale per seller?
I have the following table: VENDAS ------------------------------------------------------------------------------------------------------------ VENDA_ID | VENDA_RAZAOSOCIAL | VENDA_CIDADE |…
c#asked 9 years, 4 months ago Rennan Hanna 107 -
1
votes0
answers47
viewsHow can I capture a BD record for a combobox and after selected filter with a boot?
I have a Chart, a datagrid , two maskedbox with dates , a boot filter and a combobox. I can already filter my records in BD and display on datagrid and Chart, but I still can’t filter the sales of…
c#asked 9 years, 4 months ago Rennan Hanna 107 -
1
votes2
answers254
viewsRetrieve part of a string (split or index)
I have a folder structure like this: bco_img/3/foto_produto/ bco_img/3/foto_produto/tb/ bco_img/4/foto_produto/ bco_img/4/foto_produto/tb/ etc... I want to recover the folder /3/ after /4/ and also…
-
1
votes1
answer743
viewsAPI for viewing places on the map
I am in need of an API that works like HERE Maps, which enables an easy query through a REST service. With it, for example, I can identify stores within a certain range. But I came across the…
-
1
votes1
answer176
views -
1
votes1
answer3095
viewsConvert a date into yyyy-dd-mm format to dd-mm-yyyy
I’m trying to do a search in my database where the goal is to search between two dates entered by the user, and that it shows me all the values that are in this date range, but I’m not able to get…
-
1
votes2
answers794
views