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
votes3
answers1139
viewsRoute to static pages in MVC
I have a question about the application ASP.Net MVC: Structure Views | +-- Home | | | +-- Index.cshtml | | | +-- Page.cshtml | +-- Users | | | +-- Details.cshtml | +-- Paginas | | | +--…
-
1
votes2
answers592
viewsClosing modalpopupextender at the button click
I am using a modalpopupextender with C# .NET. When I click on my gridview button, it calls the popup to edit the necessary information. When I click on update or cancel, nothing happens! It’s like…
-
1
votes2
answers507
viewsWebclient request returns empty
In my program I need to get the contents of my site, but the return of the downloadString method of the Webclient object returns null. The most intriguing is that there is no exception, the status…
-
1
votes2
answers3428
viewsTake the value of an input type=text and play in a variable
I am using ASP.Net-mvc4] in my C# project in Visual Studio and I need to get the value of input type=text that’s in my view, and play in a variable on my controller, but I couldn’t find a way to do…
-
1
votes5
answers38715
viewsCalling a form and closing a form in the same event
How do I call one form and close a form at the same event. For example: private void iniciar_Click(object sender, EventArgs e) { Close(); Frm1 newForm2 = new Frm1(); newForm2.ShowDialog(); }…
-
1
votes2
answers60
viewsCan I override already existing anottation on . net?
I have the following Annotation: [XmlElement(IsNullable = true)] I’d like to see the code behind it, so I can create my own based on it Or if you can write her up…
-
1
votes1
answer754
viewsHow can I pass a class value to a Listbox
I am involved in a small personal project, composed of some classes and many photons. I need to send a value that is obtained when I access a certain button, to the listbox that is in one of these…
-
1
votes1
answer398
viewsWeb API 2 - Use of Reasonphrase in exception handling
var resp = new HttpResponseMessage(HttpStatusCode.NotFound) { ReasonPhrase = "Nenhum produto encontrado" }; throw new HttpResponseException(resp); That code should return 404 No products found But…
-
1
votes1
answer72
viewsTelerik Radribbonbar - strange behavior
When configuring text and images in a RibbonBar, along with its alignments, suddenly the window became too small, preventing any way to increase its size (Windows form, Telerik v2014.1.228.40,…
-
1
votes1
answer285
viewsAsp.net Identity Good practice authorization
I have my user using Asp.net Identity for authentication as usual I have my class implementing iuser public class usuario: IUser { public User(){...} public User(string userName) (){...} public…
-
1
votes2
answers65
viewsConsulting type passed via generic method
I have the following situation: public List<TEntidade> MeuMetodo<TEntidade>() { //My Code Here } Is there any way I can catch this guy from Tentity? The ultimate goal is to use this Type…
-
1
votes1
answer474
viewsRegistration via facebook api
I would like to know how to set up the facebook app so that it can receive data from any user.. I tried unsuccessfully defining these 2 fields that facebook provides me: FaceBookConnect.API_Key =…
-
1
votes1
answer80
viewsHow to make STS request User PIN after Logout
I’m having trouble executing a logout of the application using STS. After clicking the Logout button, I Expose all the cookies I have, until I give the signout command of Federationauthentication,…
-
1
votes2
answers368
viewsOverride Xmltextwriter - Serialize Class for XML absolutely all attributes
I have my class: public class Pessoa { public int Id {get;set;} public string Nome {get;set;} } I’m trying to serialize for XML this class of mine. public static string CreateXML(object o) {…
-
1
votes1
answer1338
viewsAnimation library c#
In c# there is some kind of jquery-like library in the sense of making animations effects with form elements like making a text move from one side to the other and etc?
-
1
votes3
answers1948
viewsSet value of a null or Empty ROW on a gridview
I bring a Datatable from the database and fill in a gridview, need to leave some ROWS blank or with nothing, but the fields are numeric and do not accept string or other kind. DataTable dt =…
-
1
votes1
answer161
viewsActivex Axvlcplugin2 no event works
I possess in my form a VLC Player. In it, I need to get basic information like video duration and current position. but no event works. Am I doing something wrong? Follow code: public Form1() {…
-
1
votes2
answers998
viewsMethod does not work when called
I have two forms: In the form1 there’s a ListBox with some pre-entered data and a method. In the form2 there is a button that executes a method in the form1. //form1 public void limparListBox() {…
-
1
votes1
answer671
viewsKendo UI Grid Export Excel
I have the following Grid in *.cshtml: $.ajax({ url: '@Url.Action("RetornaJsonGrid", "PacoteLicencas")', type: "post", cache: false }).success(function (json) { $("#gridPacoteLicencas").kendoGrid({…
-
1
votes1
answer897
viewsOntextchanged called several times - autopostback
I’ve got, like, 50 Textboxes with this guy: <asp:TextBox ID="txt_DetImovel0" runat="server" AutoPostBack="true" OnTextChanged="txt_DetImovel0_TextChanged"></asp:TextBox> <asp:TextBox…
-
1
votes2
answers741
viewsDefinition and utility of partial class
What is the use of a partial class, and in which situations is it recommended to use them? I have some classes in a project that are partial classes and I suspect that an alleged problem is related…
-
1
votes3
answers4590
viewsSQL use variable in column name
I need to use variables to set the column name in my sql query. Gender: SELECT IDLayout, Nome, @collum, TipoProduto FROM ProdutoLayout WHERE (TipoProduto = @tipo) AND (@collum = 1) Whereas the…
-
1
votes1
answer328
viewsSomething wrong with references using two layers in Entity
I made an example in Entity 5.0 and with 1 layer worked perfect. Now I’ve separated into UI and DAL, but this giving error. The same page that worked in the layer DAL when made in the UI is giving…
-
1
votes2
answers6454
viewsHow to clean the combobox without losing the items?
How to clean the combobox without losing the items? I try to clean up the combobox in C#, but either it eliminates all options or the selected one, as I do to clean without losing items?…
-
1
votes1
answer484
viewsHow much to charge on a website?
Much is said about how to develop a web application, a website or even an e-commerce. But one question that I think a lot of developers have is, "How much should I charge from this site?" How much…
c#asked 10 years, 6 months ago Matheus Bessa 1,261 -
1
votes1
answer1189
viewsHow to get Paramentro in a C# sent from Android web service
I’m consuming a web service developed in C#, from an application on Android. By sending simple types per parameter such as string, int or long, I can usually get the information just by placing the…
-
1
votes2
answers1234
viewsStore shopping cart on customer or server?
What better way to store items from a shopping cart? In itself javascript, on the client side or in a session on the server, either using $_SESSION(php) or Session["sessao"](C#) Which would be…
-
1
votes1
answer256
viewsGet Weekday through a LINQ date
I need to get a record set of a respective day of week(Example Second), where for this I have a field in the table of type datetime. In Sql would look something like this: SELECT AVG(P.Quant) AS…
-
1
votes3
answers542
viewsReceive a Model per parameter in a function
I’m trying to get one Model in a function, which is a step view (although I don’t know if it’s possible) to then generate a list and generate a PDF. My View: @model…
-
1
votes1
answer364
viewsHow to get a Mysql output Parameter via C#
I researched and applied what I saw, but is giving error: MySqlConnection con = new MySqlConnection(banco.Conexao); MySqlCommand comando = new MySqlCommand("sp_venda", con); comando.CommandType =…
-
1
votes2
answers884
viewsHow to call an ASPX page function in another project?
How to call an ASPX page function in another project? When clicking insert I call a project to make the business rules, at a certain moment I need to call a C# function that is on the page and after…
-
1
votes2
answers2473
viewshow to extract zip files in c# to a folder where system is installed
How to Extract Zip Files in c# to a folder where the system is installed? using System; using System.IO.Compression; using System.Windows; using System.Xml; namespace TestXml { /// <summary>…
-
1
votes1
answer110
viewsWCF Restful Https for a Single Method
I have a WCF Restful that I am using for a mobile application, I need a single method, the payment, use HTTPS, I do not want to enable HTTPS for the entire service because some methods return a…
-
1
votes1
answer208
viewsController and View Structure
A help not to do something much more laborious than it can be right away. I have the following classes in my Model: public Pessoa { public int Id { get; set; } public int TipoPessoaId { get; set; }…
-
1
votes1
answer64
viewsDynamically manipulate webcontrol element
There is how to manipulate webcontrols name dynamically? ex: I have 90 Textbox textBox_01_name textBox_02_name textBox_03_name textBox_04_name ... today I have the following code if…
-
1
votes1
answer1215
viewsProcess.Start(variable) to open an application without knowing the installation location
I have a Console Application that needs to call an application. Since I won’t be sure where it was installed, I need to assign the value to the path variable as below to get the application…
-
1
votes1
answer2741
viewsMove files between folders with C#
I have an application that checks and downloads a file as soon as it runs through the Window_Loaded. Here is the method that performs this task: XmlDocument doc = new XmlDocument();…
-
1
votes2
answers1405
viewsBest way to add multiple order items to a table
When I add a request to the table TB_PEDIDOS, TB_PEDIDOS: ID_PEDIDO, DATA_PEDIDO, ID_CLIENTE I also need to add order details to another table: TB_DETALHES_PEDIDOS: ID_PEDIDO, ID_PRODUTO,…
-
1
votes3
answers435
viewsProblem with users when publishing application
I am using SQL Server 2012, and when publishing my application, both on the client server and on my pc everything works well. As connection strings for the BD are correct, everything looks good. Now…
-
1
votes3
answers3432
viewsHow to take values from a Session and download them into variables?
I made that class: public class ConexaoParametrosTFV { public ConexaoParametrosTFV() { if ((SessaoUtil.Recuperar("ConexaoTFV") == null)) { AgaxturCmsEntities db = new AgaxturCmsEntities(); var…
-
1
votes1
answer138
viewsWhere can I find the DLL microsoft.expression.Encoder.Devices?
I’m trying to develop a string instrument tuner in C#. I found a project called FFT Guitar Tunner, but I’ve been having some problems with his references. After all the only reference that keeps…
-
1
votes2
answers957
viewsLoading a report in Web Forms
I intend to generate some reports in my application and I am using Crystal Reports. The Report itself is correct but I can’t load it on my page (.aspx). Follow the Load event code of my application:…
-
1
votes1
answer101
viewsHow to change the image by Behind code
I want to change the image by Behind code, but the way is wrong. How do I find my way? BitmapImage image = new BitmapImage(new Uri("/Images;Assets/Images/ativo.png", UriKind.Relative)); img.Source =…
-
1
votes2
answers222
viewsCreating a collection
The two images are as mine array is. In the first image I have an array with 3 items, being the first of the month of April and contains 4 passages. For each passage I have the respective…
-
1
votes1
answer1497
viewsSystem.Web.Mvc.Web missing, what can I do?
After a few updates, my helpers started giving problems, for example, if I were to use the @Html.TexBoxFor, Razor would never recognize. After doing a lot of research, I was asked to use the @using…
-
1
votes1
answer299
viewsHow do I leave specific items in my dynamic listbox disabled?
I have a Listbox that is dynamically loaded using EF. One of the filters used is that the product exists in stock. var query = (from p in db.Products join s in db.Stocks on new { p.SchoolID,…
-
1
votes2
answers282
viewsRelate Check Boxes to Radio Buttons
I’m with a project where I have to put occurrences. This is a school project. So the occurrences would be like this: An occurrence would be a warning or a suspension, and its causes, that is, messed…
-
1
votes2
answers771
viewsBring three possible results with Lambda
I need it in one expression to bring three possible outcomes. If date is up to 15dd, returns 1, if it is between 15 and 45 dd returns 2 and if it is larger than 45 returns 3. This is my lambda and…
-
1
votes2
answers439
viewsHow to allow read-only for a certain type of user?
I have a button that triggers an event to close a school year. By clicking this button, the person can have access to all the screens of the system, but can not edit anything, delete, insert. Is…
-
1
votes1
answer13532
viewsC# Select and display in a combobox
I’m creating an application in C# windows Form and wanted to know how to select a table and display a list of clients in a combobox.