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
votes4
answers4412
viewsHow to set the data of a Datagrid to a Textbox in C#
I am trying to set the data of the selected Datagrid line, which comes from B.D., to show in each Textbox. The data of each column of the selected row goes to a Textbox. How do I? Which method to…
-
2
votes1
answer277
viewsError in runtime VB6
I have a DLL that was created in . NET and I need it to run as COM+. code in . NET: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace thiago.dll.NET {…
-
2
votes1
answer268
viewsHow to hide images from 'Resources' folder?
How do I create a file to put the images in the 'Resources' folder? I don’t want the people who use my program to have access to them. The file can be any extension.
-
2
votes2
answers9832
viewsTransform Rotation with Unity3d
I’m wanting to develop a game (starting studies now), and I’m having a hard time: I have a scenario that is basically a planet and on this planet I can put objects that will "aim" at the player...…
-
2
votes1
answer987
views -
2
votes2
answers256
viewsNumber of variable parameters in C#
I know you can do this. But I can’t find how. How do I make a function accept a variable number of parameters of the same type, similar as an array? So I can just call it that:…
-
2
votes1
answer116
viewsThrottling to a Method
I was experimenting with the concept of throttling and some doubts have arisen Part 1: How to translate this concept into a single word? Part 2: Is there a library that has a simple implementation…
-
2
votes3
answers263
viewsIntellisense disappears when the list of arguments is large
I’m using Visual Studio 2010 realized that when the list of parameters of the constructor is too large and does not fit on the screen Visual Studio no longer displays the list of parameters of the…
-
2
votes1
answer2918
viewsHow to restrict certain file extensions and save to database?
I need to upload images to my database and will use the data type as Bytes in the SQL Server database. How do I guarantee that really would be an image that will be passing to him? I want to leave…
-
2
votes1
answer6871
viewsAuthentication and User Permission with MVC
I’m developing an MVC 3 application, using C# for Models and Controllers and Razor with HTML for Views. I want to implement authentication and user permission to the system. How can I do this using…
-
2
votes2
answers167
viewsError in calculation of execution
I have the following question. I have these following times obtained through the Stopwatch, where it was placed within a method to return the employee’s hours bank balance. Only that he is showing…
-
2
votes3
answers1069
viewsjQuery multiline highcharts
I have an MVC application and would like to clarify some questions on how to implement a chart with database data. I am using jQuery to get the values from the database, but did not understand how…
-
2
votes5
answers1056
viewsHow do I connect Windows Phone to an SQL Server?
I’d like to know how to access and receive data from a server from Windows Phone. Put simply: I have a PC and want to access a document directly from the smartphone.
-
2
votes1
answer512
viewsClose a Mysql connection without committing or rollback to c# Asp.net
I would like to know what happens in the following scenario: In a program Asp.net with c# was opened a MySqlConnection, soon after a MySqlTransaction, was held a insert in the open transaction,…
-
2
votes1
answer651
viewsHow to access child items in a Boundfield of a Gridview in Asp.Net Web Forms?
I know in the middle of a GridView, an immediate item can be read with the tag BoundField: <asp:BoundField DataField="MeuItem" HeaderText="Meu item" /> But I get a mistake trying to do that:…
-
2
votes2
answers1033
viewsChange a detachable PDF field
I’m working on MVC 4 and installed the iTextSharp to create PDF’s, until everything well. But what I am doing is replicating a PDF that already exists, to fill the respective fields required in this…
-
2
votes3
answers3702
viewsHow to get the dynamically created Textbox value?
I have a form that receives an amount of Textbox that must be instantiated, the page then generates the textboxes, but I do not know how to take the values. hd = Request.QueryString["qtHD"]; mem =…
-
2
votes2
answers612
views -
2
votes3
answers4012
viewsConfirmation of closing the form
I’m trying to create a confirmation for when the user tries to close a form either with a button, or by the button x, or Alt+F4, or right-click at the top and then click close, etc... I tried to use…
-
2
votes2
answers163
viewsArray of bitmaps firing Outofmemory even having sufficient memory
Problem I am having problem in my program that when the process reaches more than 1.5 GB of memory usage the process stops running and displayed an error of OutOfMemory. In my process I’m reading a…
-
2
votes1
answer179
viewsAssembly structure in a project using the Pattern MVVM
I’m having trouble organizing the Solution of a project using the MVVM. I don’t use any MVVM framework. I currently have the following structure: Solution | --- AppView (Projeto principal onde estão…
-
2
votes1
answer241
viewsHow to Redirect after STS authentication?
My application authenticates users through STS. Authentication can go to STS and validate the user PIN on the card. But how do I have it redirected to the "home" page of my site after…
-
2
votes2
answers1323
viewsCreate and Edit Onetomany with Viewmodel
I am creating a simple news application in ASP.NET MVC 4. I have a News class and a Category. I made a Viewmodel public class NoticiaCategoriaVM { public Noticia Noticia { get; set; } public…
-
2
votes1
answer1806
viewsCell width Pdfptable iTextShar MVC 4
I’m using the iTextSharp to create PDF’s in my application. However I have to recreate a table, where I have to set the size for a column rather reduced. Follow the image that shows the size with…
-
2
votes3
answers2384
viewsMedia Player Classic libraries in my Windows Form project
I am developing an application that will work as a player, however the videos inserted in my software will be of various different formats avi, mp4, flv and etc... for this reason I do not want to…
-
2
votes2
answers1555
viewsCalling action with AJAX, but does not return Alert to view
In the textbox Ticket, at the event onChange() I call AJAX below: $('#Ticket').on('change', function () { var tkt = this.value; $.ajax({ url: '@Url.Action("VerificaTicket", "Oc")', data: { 'tkt':…
-
2
votes1
answer341
viewsPortable Database for WPF + C#
I am creating a form in WPF + C# in VS Express 2013 for Desktop. Is there any database similar to Sqlite that I can use with C#+WPF? Because as I come from the development in Delphi I got used to…
-
2
votes2
answers222
viewsWhat difference xmldocument vs xmlwriter?
What is the difference between the two classes? In which situation each fits best?
-
2
votes2
answers2118
viewsHow do I set a Radiobutton to default?
I have several radiobutton’s. How do I leave one marked as default? private void radioButton2_CheckedChanged(object sender, EventArgs e) { comboBox4.Visible = false; comboBox5.Visible = false;…
-
2
votes2
answers1042
viewsCollect information from system resources
I’m using S.O. windows, and C programming language#. How to collect system resource information in C#? processing, memory, disk. I’m running performance tests, with multiple clients and a server…
-
2
votes1
answer1354
viewsUpload multiple files using Uploadfy in ASP.NET MVC
How to implement multi-file upload with uploadf? I find it very interesting to use the upload bars etc. is making this mistake: This is my controller: You may notice that you have many error…
-
2
votes2
answers987
viewsGridview ASP.NET c# data from the same table
I have the following table in SQL with the following fields (id, name, day week, active). id the primary key of the whole type; nvchar day nvchar week; active bit; and I have the following data in…
-
2
votes2
answers1318
viewsHow to write HTML inside Ajax Success
I have a project in ASP.NET MVC 4 and in it I have a requisition Ajax where calls the controller sending only one parameter. The request does everything correctly, brings me a list with the data I…
-
2
votes3
answers2078
viewsQuestions about relationship and mapping with Fluent API for EF 6
Whenever I have a class with properties that are of the type of other classes, which at the database level represents a foreign key, I will always need the navigation properties? And look at this…
-
2
votes1
answer338
viewsGet value from XML
I’m having trouble getting the value true of this XML: <boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean> I tried this way but I couldn’t: var ns =…
-
2
votes4
answers6360
viewsBreak row into table cell in CSV format to be read by Excel
I have the following code that inserts a value in an excel cell for export context.Response.Write("aa\r\nbb\r\nccc"); /r/n breaks the line but writes in the cell below, would like to break the line…
-
2
votes2
answers217
viewsForm in view with subforms in partialView
Dear friends, I have a view containing only @model Projeto.Models.Oc and a form. Within this form, I have buttons that call MODAL, those MODAL possess partialView who owns another form and @model…
-
2
votes1
answer169
viewsUpdater of a web application Asp.net mvc
I was here thinking of a framework for automatic updating of my web systems in clients, so I thought of using the ClickOnce with some gambetas(technical adaptations). It did not work, it works only…
-
2
votes1
answer1551
viewsMove image inside a picturebox with the mouse without using the scrollbar
Please, does anyone know how I can move an image inside a pictureBox without having to click on scrollbar? What I want is to move the image, just by clicking the mouse on it so as to drag it inside…
-
2
votes2
answers1253
viewsHow to search and sort Templatefields on a Gridview?
Basically, I have a table (Gridview) on an aspx page whose data are defined by Templatefields. For example: <asp:GridView runat="server" ID="grdProdutos"> <Columns> <asp:TemplateField…
-
2
votes1
answer399
viewsHow to display two pages of the same Gridview side by side?
I would like to know how to display two pages of the same GridView side by side, if possible keeping the pagination on both pages at the same time. For example, if I have a GridView in that way: Num…
-
2
votes1
answer820
viewsHow to create a query with Union using Nhibernate
I need to implement a query in nhibernate make a union between 2 tables. In sql, it would be something like that: SELECT T1.Id AS ID FROM TABELA1 AS T1 UNION SELECT T2.Id AS ID FROM TABELA2 AS T2 I…
-
2
votes1
answer601
viewsIs there any way to compress data stored in byte[]?
I get a byte[] which is an image, and saved in the bank (Postgres) in a column o byte[] whole. Can I compress? Make this smaller byte[]?
-
2
votes3
answers240
viewsHow to display "from" inside the Datetimepicker
In the DateTimePicker I can display anything using d to day, MM or MMMM for month and yy or yyyy to year. However, I would simply like to display on the property customformat: April 15. But when I…
-
2
votes1
answer2236
viewsDynamically Create Datatable
I need to create a DataTable Dynamic; of the kind: List<p> =... List<l>=.... DataTable dt = new DataTable(); foreach (Prod pr in p) { dt.Columns.Add(prod.Nome.Trim()); for (int i = 0; i…
-
2
votes1
answer3975
viewsRead a JSON from a URL
I need to read a JSON file, which is generated by PHP, through the json_encode; I have no idea how to do this, you have some example? Observing: Is in Windows Phone 8 C#! The answer the url gives is…
-
2
votes2
answers2412
viewsHow to implement an abstract method in a daughter class?
I abstracted a method from an abstract class as well. But I’m not sure how to implement this method in the daughter class. Here’s my code, what I fix? using System; using System.Collections.Generic;…
-
2
votes1
answer1249
viewsASP MVC 4 and Webservice
I have a Webservice with all the methods I need to make the system work and I also have a page ASP NET MVC 4. I already referenced the Webservice Referral Service. I can access a method that returns…
c# asp.net-mvc sql-server web-service visual-studio-2013asked 10 years, 6 months ago Thiago Alex 349 -
2
votes1
answer96
viewsHow to get data from a Bulletedlist in Codebehind ASP.NET?
I have a list of items defined through a Bulletedlist on an Asp.net. page This list is populated with multiple items through attributes DataSource, DataTextField, DataValueField and the method…
-
2
votes2
answers282
viewsError while trying to connect to database
I’m studying about C# and Asp.net and "trying" to draft a registration, amendment and exclusion project, following some videos lessons I found on the net. The problem is when I connect the database…