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
votes1
answer4074
viewsThe 'X' type initializer has triggered an exception
While trying to run the line below, I get the following error message: An Exception of type 'System.Typeinitializationexception' occurred in Programa.exe but was not handled in user code. Additional…
-
2
votes1
answer1405
viewsWhat are the layers and folder names for organizing projects?
I have an application that will need to be developed as follows: Web Application (probably MVC) Web Server Application (WCF - Run on IIS) Client Server Application (WCF Windows Services) Client…
-
2
votes1
answer601
viewsHow to transform Amble expressions into sql commands?
How can I manipulate expressions to help automate the creation of SQL commands like Linq to SQL? So: using Entityframework I can make queries such as: var livros = contexto.Livros .Where(livro =>…
-
2
votes1
answer332
viewsInheritance in Database
I am developing an application, where I have 3 tables that have the same attributes, but as they had attributes in these tables that were mandatory for some, and not for others, I decided to…
-
2
votes3
answers4786
viewsLine break into email message
In my string mensagem, i would like to have a two line space, I tried using "/n" and I did not get the expected result. @{ var customerName = Request["customerName"]; var customerEmail =…
-
2
votes2
answers1202
viewsInstantiate dll created in C# . net for VB6
I have a dll that I want to consume, developed in c#, and I want to upload this dll to VB6. How can I do this? What steps should I follow? Inside the VB6 code below you already have a call to this…
-
2
votes1
answer3348
viewsPDF reading . NET
I have been researching for a long time a way to read a pdf document that contains Sinapi Inputs tables and save the data in my database, and I do not do the least how to, someone could give a hint?…
-
2
votes1
answer1412
viewsHow to instantiate an object of this class in C#
I’m reading Caelum’s booklet about C# and object orientation, so I put it in Account.Cs the following code: namespace Banco { class Conta { public int numero; public string nome; public double…
-
2
votes1
answer221
viewsHow do I not lose my Gridview lines that were dynamically created in Rowdatabound?
The grid is already being mounted correctly. However when I give a Postback by clicking on some button on the page, the grid is maintained and only the headers (lines in purple) disappear. I know if…
-
2
votes1
answer78
viewsSearch information in more than one table
In my project I currently have 3 tables: Students, Occurrences and Users. In them I have the views and the controllers. So far, so good. My relationships are: Allunos&occurrences(1,N) /…
-
2
votes2
answers713
viewsHow to instantiate primary key in another MVC class?
I have the class Funcionario and Projeto. They both have their Ids. I want to create a class ProjetoFuncionario and would like to instantiate the primary key of the two in this class. How can I?…
-
2
votes1
answer130
viewsSearch with Checkbox
I am trying to create a search system in my application where the user can search the site publications according to gender. I can list the generos registered with checkbox, but I’m lost to do the…
-
2
votes1
answer917
viewsHow to force an entry Numeric on android work with comma instead of point to decimal numbers?
I tried to use Culture but it didn’t work either and I didn’t want to do the trick of putting a replace before sending it to the base. Even with the Xlab I could put the keyboard to work ptbr and…
-
2
votes1
answer101
viewsC# Opening Files
I wonder how to open a file in your native program with C#. Example: I have a file .xls (spreadsheet). When I want to open it, my system makes a request and opens it in excel. Thanks in advance…
-
2
votes1
answer86
viewsConvert.Todatetime returns the previous day
Using C#, when I run it: Convert.ToDateTime("Wed, 20 May 2015 01:36:39 +0000") He returns it to me: {19/05/2015 22:36:39} Date: {19/05/2015 00:00:00} How does it return the correct value?…
-
2
votes1
answer105
viewsHow to make the gun disappear in the same key that makes it appear in UNITY
using UnityEngine; using System.Collections; public class SelecteArma : MonoBehaviour { public bool Equipamento = true; void Start () { } void Update () { if (Input.GetKeyDown ("1")) {…
-
2
votes1
answer94
viewsHow to fire an event when a List is changed?
I wanted to know if it’s possible and, if so, how to trigger an event when a List shall be amended as follows:: An element is removed; An element is added; An element has its index changed; Is there…
c#asked 9 years, 4 months ago Felipe Avelar 9,507 -
2
votes1
answer3305
viewsGet path from desktop
Boas, last week I put here a question: Automatically save to Default Folder C# I have now created another form, and I want Load to automatically fetch the file from the Desktop. However I can not…
-
2
votes1
answer156
viewsWhat is more advisable? Perform the query through a list or directly in the database?
I have to perform a consultation where I need to do 4 INNER JOIN and still use WHERE in various fields. What is most advisable? Conduct the consultation in this way? using (DbContexto db = new…
-
2
votes1
answer99
viewsReset to auto increment
I have a problem at my base of fingers. I have the sending code as auto increment but whenever I delete a sending code the value not reset or I do not restart will always increase. I wanted to know…
-
2
votes2
answers116
viewsHow to debug to know which database or table are running with Asp.Net
I’m 10 days into my new job, and I’m having some difficulties - which is normal, depending on the difficulty. I have a Table inside a Repeater, which is powered by a Procedure. Like I do with Debug,…
-
2
votes0
answers434
viewsError 501 when connecting with FTP
I have a C# (Windows Forms) application that accesses the company’s FTP to download some files and/or upload. Only, on two specific clients, the application cannot access FTP. It gives the following…
-
2
votes1
answer296
viewsGridview with only one line - Asp.Net C#
I have a column in Gridview with Schedules, I made a scheme that takes from such an hour to such an hour for example: 8:00 to 8:30 and so goes to other lines. In all, until 6:00, that’s 20 lines.…
-
2
votes1
answer359
viewsBetter performance in a WPF system
How to leave a system in high performance? Follow a MVVM project pattern? I have the following XAML, but when I run it hangs in time to pass the focus to others textBox. Why? My system is too slow,…
-
2
votes2
answers944
viewsRight-click options menu selected in datagrid
Hello, I have the following problem: I have several records on datagrid and I want the moment I select a record and right-click on it, a menu with options for the selected row appears. The only…
-
2
votes0
answers186
viewsHow to use Hasmorepages on this occasion?
Well, I have a printing system here that is working perfectly. The problem I am facing is regarding the use of bool HasMorePages. I’m not sure how to implement it to print multiple pages if the…
-
2
votes1
answer615
viewsSyntactic sugar?
I came across the term syntactic sugar these days when I was studying the use of await and async in C#. This question explains what syntactic sugar or syntax sugar is What is syntax sugar and how it…
-
2
votes1
answer3034
viewsIIS - Access denied directory
I am using windows server 2008 and IIS 6.1, I have a service that needs to access files in a certain directory, but I do not have access. What I need to configure to get access? After adding…
-
2
votes1
answer43
viewsEdit default Errotemplate layout
I implemented the interface Idataerrorinfo, that is working according to the image below. I didn’t create my Errortemplate, what is being used is the . NET default. I wonder if there is somewhere…
-
2
votes0
answers139
viewsHow to connect Prolog with c#
I wanted to know how to create a knowledge base in prolog and use it in a interface maid in the c# or java, create new clauses via interface.…
-
2
votes1
answer1119
viewsHow to create a Cascading Dropdown?
I would like to create a Dropdown dependent on another Dropdown in C#, ASP.net - MVC 5, in case it would be a dropdown with the names of all customers and then another Dropdown with the phones of…
-
2
votes1
answer56
viewsAuto adjustable list in shampoo
I have a list of BitmapImage and wanted it to appear as follows, 3 images per line, if you do not fill a line, stay a blank at the end. For example, I have my list with 10 small images and I want it…
-
2
votes2
answers674
viewsPassing parameter between pages
How to pass parameter between pages in Windows Phone 8 . 1? In the previous version it was made like this: Pag 1: private void Button_Click(object sender, RoutedEventArgs e) { string uri =…
-
2
votes1
answer1270
viewsPrevent user from being logged in twice
In my project, I have a login module that works perfectly. Until then quiet, but the way it is I can not bar the same user logged in twice. That is, I can log in with the same user twice, and that’s…
-
2
votes1
answer105
viewsPerform a redirect in Constructor
How can I make a Response.Redirect() in a class builder? public class FarmaciaController : Controller{ public FarmaciaController(){ if(!userLogin.usuarioTemPermissao("Farmacia"))…
-
2
votes3
answers1096
viewsPass Viewbag to _Layout
I need to pass a list to my layout where it is used in all my pages, I would like to know how I could do this?
-
2
votes2
answers460
viewsProblems with Selectedindexchanged Asp.net C#
I added it in the method where you load the list from the bank: ddlSalas.Items.Insert(0, new ListItem("TODAS", "")); When I choose this "ALL" option on dropdownlist, happens a post on the page but…
-
2
votes3
answers698
viewsUnit tests with Nunit
I just installed in my project the "Nunit" for unit testing. Installed via Nuget, on the VS2013 console. I put the notes on top of my methods I went on Explorer test and gave a "Run ALL". This "Run…
-
2
votes1
answer257
viewsCrystal Report with LEFT JOIN and WHERE
I’m having a problem making one LEFT JOIN in Crystal Reports. From what I’ve researched, it’s a classic SQL problem when using criteria WHERE crossing with the LEFT JOIN. I tried to solve every way,…
-
2
votes1
answer350
viewsDesktop applications developed in HTML CSS and Javascript
I have a MVC web application on .Net. I need to migrate there to desktop. However I would like to keep my application with Web Views. I know that for Android app and IOS it is possible to reuse the…
javascript c# html css desktop-applicationasked 9 years, 3 months ago Luã Govinda Mendes Souza 1,072 -
2
votes3
answers7352
viewsQuery Status Nfe C#
I am trying to perform the service status query for Nfe 3.10 but always is returning the following message: The HTTP request is prohibited with the authentication scheme client 'Anonymous'. I’m…
-
2
votes1
answer3455
viewsPrint Reportviewer report directly, without preview
I need to send a report directly to the printer, without preview or PDF generation. The problem is that the application is Web Forms and all the solutions I’ve found so far provide support only for…
-
2
votes0
answers76
viewsHow to use different language Resources in C#
The following is, by entering some tutorials I was able to create two Resources for my application, and both are working, because when you change the language in the language field of the Form…
-
2
votes2
answers533
viewsCreate a type corresponding to a playing card
I need to create a guy that matches a playing card. I tried it like this: Create a class for each suit and within the class create the properties of those classes that would be the cards themselves,…
-
2
votes1
answer183
viewsFetch phrase within files . Cs from a specific folder using C#
I would like to know how I can find a phrase inside files . Cs of a specific folder. You don’t need to develop code, I just want to know what/what functions to use and how to use them. I couldn’t…
-
2
votes0
answers7250
viewsError: Unable to load file or Assembly
I am developing a desktop application with c#, and is giving the following error when I do some interaction with the Bank. An unhandled exception of type 'System.IO.FileNotFoundException' occurred…
-
2
votes1
answer103
viewsYou doubt Asp.Net MVC
The structure is View -> Controller -> Model ? I work with three layers but it’s not MVC. What does that stretch mean ? @{ ViewBag.Title = "Index"; } What is Actionresult ? You don’t have…
-
2
votes1
answer136
viewsAdditional settings for referencing . NET 4.0?
Today when trying to publish a new version of my application, the following error appeared: Error 26 Mixed mode Assembly is built Against version 'v2.0.50727' of the Runtime and cannot be Loaded in…
-
2
votes1
answer275
viewsCheck the size of`Sessions` on the server
The following method is used in a web form application to store logged-in user information: public Usuario UsuarioLogado { get { if (Session["Usuario"] != null) return (Usuario)Session["Usuario"];…
-
2
votes1
answer867
viewsError 403 - the web server is configured not to list the contents
I am having trouble running my local server in Visual Studio 2013. When I try to run my application the following screen appears: If you need anything else, let me know and I’ll put whatever I need.…