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
-
0
votes1
answer121
viewsUpdate Memorystream when replacing Bookmark
Guys, I’m doing a job RESTFUL in C# that has a method that receives a byte array of a document WORD, and in this document I need to replace existing bookmarks with text that are also passed in the…
-
0
votes1
answer77
viewsExpand Object to Xml
I am using Expands Object (c# VS 2013) to read a complex xml file. I now need to read this Expands Object and turn it back into an xml.
-
0
votes2
answers220
viewsGet number of computers that are using the network system
I am developing a software and the client will only be able to use the system on a certain number of computers at a time. I’d like to know how I get the number of machines that have the system open…
-
0
votes1
answer115
viewsView help typing help c#
I need that when the user type help prints a help text, but this needs to work anywhere in the code and not in some parts. Same as CMD that when someone type help appears all available commands.…
-
0
votes1
answer634
viewsMethodology and Documentation for ASP.NET MVC Projects
In the company where I work I have always been free to develop the requested applications. I always worked in a unique way despite having a co-worker because, we both developed separate projects.…
-
0
votes1
answer598
viewsHow to insert values inside a key using List and JSON
I’m trying to do something that gives me a way out of this: [ { "Nome": "João", "Comprou": [ "Carro": "Sedan", "Preco": "12000", "Moto": "Honda", "Preco": "8000" ] } ] For this I use List and to…
-
0
votes1
answer557
viewsWindows Form: Microsoft Skin
Currently, I’m seeing several programs from Microsoft and other people with this look: I was wondering if you’re a skin free and which the link hers.…
-
0
votes1
answer292
viewsSelect in two tables
Ban.cs public partial class Ban { public int IdBan { get; set; } public System.DateTime DataBan { get; set; } public System.DateTime DataDesban { get; set; } public int Usuario_IdUsuario { get; set;…
-
0
votes2
answers316
viewsWhat is the strategy to identify a right answer, without exact comparison of String?
I have a program in C# that is like a QUESTIONNAIRE, but instead of alternatives there are times when the user should type a response. The answer to the question is stored in a database and at that…
-
0
votes1
answer101
viewsPartial is not rendered
Accordingly this link from another question of mine that ended up generating error where I followed the steps referring to another question, I am experiencing a rather strange error. I created a…
-
0
votes1
answer720
viewsAdding more than one string to a List
I have a customer registration system and I am trying to add products to registered customers. For the registration list I have the following: public class Cliente { public string Nome { get; set; }…
-
0
votes1
answer548
viewsHow to print a RDLC report on Asp.net
I have the rdlc created, and have a page aspx that has a print button, when clicking on print I want to call the rdlc I have created for printing. How do I?
-
0
votes1
answer95
viewsProblem with selecting tabs
I have two tabs, one that shows my macros together and one to show the sent ones. The macros together are already selected by default and in the Page Load has the method that loads the corresponding…
-
0
votes2
answers52
viewsPrevent the user from voting in the same Post
I created a voting system, where users can give like/dislike in the chapters of books posted on the site. Follow my action: public ActionResult Like(int id) { int iduser =…
-
0
votes1
answer1269
viewsCould not load file or Assembly '.. ' or one of its dependencies. - Add a blank space on web.config back to work for hours
I have an administrative panel made in webform Asp.net C#. For a few days now, it started giving problems of the type Could not load file or assembly 'chat_megacorretor.dll' or one of its…
-
0
votes2
answers706
viewsHow to forecast a future value?
I’m making a calculator for games FPS, and in it, you enter the number of Kills, and the number of Deaths. So far so good, I was able to do the command line so she could take the two values, and set…
-
0
votes1
answer32
viewsUpload files between different sites in ASP.NET C#
I’m developing an access area for the customer where all website administration is done through it. All pages are created dynamically by making requests in a specific file on the client’s website.…
-
0
votes0
answers167
viewsHow to call Added Projects as reference in C#
I have several projects and want to make a form with buttons and call them. Researching saw that I can do this by adding another project as a reference, so far so good, more like doing after adding…
c#asked 9 years, 6 months ago Onnezimo Barbosa 11 -
0
votes2
answers98
viewsHow to avoid code redundancy in these two methods, one having a Ienumerable<> parameter and the other not?
How can I simplify these two methods in order to prevent code repetition? Method 1, with the first expression having a generic property of type Ienumerable<>: public GenericDAO<TModel>…
-
0
votes0
answers63
viewsRead page with asynchronous call
I make a call via WebRequest and this page has a Javascript function that the result of it cannot recover (it loads an image). I need to wait to finish loading the page for after the page is fully…
-
0
votes0
answers31
views01: Connection failure with TOP
I’m trying to consume a web service that I’m not an administrator of. I can normally access your classes, objects and methods. The problem is when I call the method that expects to receive requests,…
-
0
votes1
answer101
viewsDynamic column with value appearing wrong in Webgrid
I have a problem when creating a table with dynamic columns. I add the columns in a loop this way: for (int i = 0; i < attrIds.Count; i++) { resource_attr attr =…
-
0
votes0
answers148
viewsService bus configuration
I will try to detail my problem, I have WCF project hosted on IIS with auto start enabled app Fabric enabled option configured but even so the project only starts on Azure’s Relay when accessing the…
-
0
votes2
answers311
viewsDifficulty to handle button event in the itemcommand of the Peater
I have a table in a Repeater. In this table I have a Button and a Linkbutton. It turns out I need to pick up which click event was fired from the button or the linkbutton. I tried to make an if, but…
-
0
votes1
answer134
viewsImplicit type conversion error
Error 1 Cannot implicitly Convert type 'Cursocavancado.Client' to 'string' C: course Cursocavancado Cursocavancado Form1.Cs 47 31 Cursocavancado Follows the class namespace CursoCAvancado { public…
-
0
votes1
answer804
viewsRight-click options menu in datagrid
I need to create a menu with some options so that when a record is selected on a datagrid and right-click on this record a menu with the options for that record appears.
-
0
votes1
answer362
viewsReference to styles and scripts in Master.Page using Resolveurl
In Master.Page I make references to styles and scripts that will be inherited by other pages through Resolveurl. <script src="<%# ResolveUrl("~/") %>Scripts/jquery-1.11.1.js"…
-
0
votes2
answers106
viewsWindows Phone 8.1 Saving Toggleswitch Status
I have a code where I need to save the state of Toggleswitch. So that when starting the page it is with the Ison property active or inactive, according to how the user had selected. But when…
-
0
votes1
answer1128
viewsConsultation for the electronic Invoice?
I’m looking to make an appointment for Nfe RJ, but I’m getting an error. File I generated for request 33141108887109000102550010000010141000010140.xml, with the content: <consSitNFe versao="2.00"…
-
0
votes3
answers1728
viewsBack to page you called
Is there any way I can make a code on a button come out, make me return to the page you called? Fixing the page does not give, because this page(query process) is called several other. I did this…
-
0
votes0
answers69
viewsC# Treeview Doubleclick Windowsforms
private void treeView_DoubleClick(object sender, EventArgs e) { if (pRetorno == true) { if (treeView.SelectedNode != null) { pOc = new…
-
0
votes2
answers483
viewsMatch content of two objects
Use the method below to update a given table: public int alteraBem(tb_bens itemBem) { try { using (GestaoAtivoEntities db = new GestaoAtivoEntities()) { var bem = db.tb_bens.Where(v =>…
-
0
votes2
answers502
viewsLayers to develop web service
I am developing using REST (with Restfull API), where I think of using two layers in the system: BLL and DAL. BLL => Would be the layer referring to business rules. DAL => It would be the…
-
0
votes1
answer577
viewsDisable Masterpage Menu from contentPage
I have a small menu on the Master Page: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="INTEGRASYS.SiteMaster" %> <!DOCTYPE html> <html…
-
0
votes1
answer110
viewsHelp in comparison of randomized variable
I’m making a game of colors, in it I have a Random that randomizes buttons in a certain sequence. The value of these buttons are concatenated in the variavelX that sets my given sequence. ex: botão1…
-
0
votes2
answers958
viewsNullreferenceexception in User Filter
In my project I made a filter to see if the user is already logged in. To prevent the same Log twice in the system. According to the answer to my question I make a filter class and search the ID…
-
0
votes3
answers1920
viewsSearch database information by selecting a field
How to select a field and pull the information related to it? For example, I wanted to select a user and when I selected it appears in the fields type Name, Address, Cpf and etc all filled,…
-
0
votes1
answer657
viewsSelect Rows from a Datagrid and send to an Array
I have a WPF application where I have a DataGrid with various information. I wish the user could choose multiple lines and store the line information in one array (or not) for me to send to another…
-
0
votes1
answer49
viewsError while clearing a Datagrid
After I saved my items that are on Datagrid in a database, I would like you to clean up. So I used it as follows: dg.Items.Clear(); But from there comes that mistake: Operation is not Valid while…
-
0
votes1
answer402
viewsError saving data from a session in the database
I am developing a sales system. Follow the link: Save Request - ASP.NET MVC However when finalizing the purchase and saving the data in the bank, I get the following error: "An Entity Object cannot…
-
0
votes2
answers243
viewsHow can I create a Datagridview with Mongodb?
I want to present the BD data in a table, but so far I could only do it using a ListView. How can I do it but using one DataGridView? using System; using System.Collections.Generic; using…
-
0
votes1
answer256
viewsAutomatically list products from different stores
I have a question in comparing prices of products from different stores, I have no idea which component to use or how to do this. The idea is to do something similar to Buscapé and Zoom (relate the…
-
0
votes2
answers2442
viewsHow to read and open files from a byte column in SQL Server?
My question is the continuation of this question: Link to the other question I managed to transform my file into bytes and insert it into a table in SQL Server, but now I want it from inside an…
-
0
votes1
answer120
viewsInstall Mahapps.Metro on a Windows Application
You can install the package Mahapps.Retro (http://mahapps.com) is a Windows Application? Getting Started explains only, in WPF.
-
0
votes0
answers54
viewsHow to read an XML with C#?
Well I am new in C# and I have a question related to reading an XML. The XML is this: <ComportamentoPapeis> <Papel Codigo="PETR4" Nome="PETROBRAS PN" Ibovespa="#" Data="19/06/2015 17:59:59"…
-
0
votes0
answers543
viewsQuery Active Directory data in Sql Server
I have services (WCF) that do searches in Active Directory to provide data to various applications that use Microsoft Membership Provider, and also need some of this information in some queries in a…
c# .net active-directory sql-server-2008 asp.net-membershipasked 9 years, 11 months ago Rafael Carvalho 246 -
0
votes1
answer60
viewsSort values of a <li> by date C#
Is it possible to sort the values of a dropdown per day? There is a order by or have to do really if’s for such? Code example: <span class="dropdown"> <button class="btn btn-search…
-
0
votes2
answers494
viewsSave data group in Post method
I’m using the Begincollectionitem to save a list of data in my add method. For that, I created a ViewModel with the main data to the list I want to save, in the method POST. I own the ViewModel…
-
0
votes1
answer663
viewspass actionlink parameters to jquery function
How would I pass parameters from an Actionlink of a grid to a jquery function? This is the Actionlink: gridPortfolio.Column( format: @<text> @Html.ActionLink("Delete", "DeleteData", new {id =…
-
0
votes1
answer208
viewsProblem rescuing References from a query in Nhibernate Hasmany
I’m using Nhibernate with Webapi have 2 entities Profile & Personal Personal Login may have N Profile and Profile 1 Person Login. However, when I go to the Personal webservicelogin the Profile…
c# asp.net-mvc asp.net-web-api nhibernate fluent-nhibernateasked 9 years, 11 months ago Daniel Machado 1