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
answer138
viewscreate android text file on internal memory Xamarin.android
Well I’m trying to save an ip from the server where this my bd but I’m not getting because it does not give enough access to record the text file in the internal memory of the mobile phone, someone…
-
0
votes1
answer32
viewsIt is possible to change the background color of an image where this image is all white in Xamarin.Ios
I have an image that is white by default, it is possible to change this color via code? Cor ImagemFundobackground = CriarCor(RecursosCores.preto); ImagemFundo.BackgroundColor =…
-
0
votes1
answer101
viewsC# ASP.NET Get method with parameter returning 404
Good afternoon, folks, I was wondering if anyone could assist me. My Web Service has a Get method that returns the entire list of Products, however I would like to create a method that it returns…
-
0
votes1
answer101
viewsASP.NET - Using a web user control dynamically
Good staff, I have the following code html that repeats over and over again throughout the website: <div class="tab-content"> <div class="tab-pane active" id="basik"> <ul…
-
0
votes1
answer381
viewsError in this page script
I am trying to start C# studies with visual studio, but when I run the code the following error occurs I’ve looked into what happened but I can’t find out why this is happening…
-
0
votes1
answer88
viewsID "conflict" within Datalist
Good afternoon to everyone. Well, I have a datalist. Then I put a Repeater in, so far so good. But then when I execute, only the first Remap appears stylized the way I want. The rest I think should…
-
0
votes1
answer370
viewsC# ASP.NET Parameter search method returning Error 500 Internal Server Error
Good afternoon, I’m having a problem with a method that searches the products and returns a specific one according to the past code. I am getting error 500 Internal Server Error when I try to use…
-
0
votes1
answer84
viewsBasic doubt in C# (Sounds)
I am new in the forum and new C# programmer also. I made a basic software for college; a coffee maker. and in it I used sounds, but I indicated the sound in ("C:/users/...") the path on my PC. When…
-
0
votes1
answer156
viewsError showing accent words in View
Good afternoon, All words that have accent on my system are being formatted wrong as in the example below: Auto de Inspe¿¿¿o Where it was to be auto inspection. How to solve this, knowing that I am…
-
0
votes0
answers70
viewsWeb Api Calls 2
Well, I have a somewhat boring task that is the handling of Cookies, I make a request by sending as parameter a code that I want to access, my API opens the page with Webdriver, maps and takes the…
-
0
votes3
answers617
viewsMove image to another form by clicking the c# button (Visual Studio)
I’m making a parking system, in which arose the need for when the user register, in the main form appear to an icon of a car on top of his vacancy (which is a label), ie when he click the 'register'…
-
0
votes1
answer63
viewsHelp with a MVVM view
I’m reading the that MVVM tutorial. But I’m not understanding the following: <Window x:Class = "MVVMDemo.MainWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x =…
-
0
votes0
answers136
viewsPass Login Enter Password to an external application. C# with Windows Forms
I used the code passed in Write program in another’s textbox To write login/password in another manufacturer’s program. I did so: Process processo = Process.Start(@"C:\Program Files…
-
0
votes0
answers64
viewsQuery on table name by Reflection
I’m trying to make a query in the table, which her name will come by the scope of the method, but does not allow me to use Select(); or Where(); System.Type referenceTableType =…
-
0
votes0
answers43
viewsLosing Data from Designer.Cs File While Opening Form - C# Windows Form Application
I have a custom editor that adds buttons to a collection. This procedure is working well, the data is serialized in the Designer file but when I reopen the form or build the project, the data that…
-
0
votes1
answer228
viewsView photo in Toolbaritem Xamarin Forms
I need to display the photo on the right side of the menu with the ToolbarItem. I return the photo from the database to the property "Photo" type string. Convert the photo string to Base64 and…
-
0
votes0
answers192
viewsError added reference Nferecepcaoevento4
I’m having trouble adding a reference to the service Nferecepcaoevento4, SEFAZ Ambiente Nacional. Service address: https://www.nfe.fazenda.gov.br/NFeRecepcaoEvento4/NFeRecepcaoEvento4.asmx?wsdl. I…
-
0
votes1
answer40
viewsDatapicker com @Html.Editorfor
I have the following model [DisplayName("Data Inicial Contrato")] [Required] [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] public…
-
0
votes1
answer164
viewsHow could I reverse the way a foreach travels through the object?
Code to follow: foreach(Control objCtrl in groupBox.Controls) { if (objCtrl is NumericTextBox) { int i = objCtrl.Text.Length; MessageBox.Show(i.ToString()); if (String.IsNullOrEmpty(objCtrl.Text) ||…
-
0
votes1
answer58
viewsImprove routes
Do people have a better way to do these routes? Or for every action in my Controller I’ll have to create your routing? app.UseMvc(routes => { routes.MapRoute( "Login", "Login", new { controller =…
-
0
votes2
answers100
viewsHow do I not repeat the value of an html cell
How do I not repeat the value of a cell in an html table ? For example I don’t want to repeat the cell value **DataPedido** The query that will return me the data is this: var _listaPedido = from…
-
0
votes1
answer1829
viewsCall action with button click by passing parameter
I will have 3 buttons, each with a different id, how do I pass this id to my controller action when clicked? public IActionResult Index(int id) { var lista = _listaService.sites(id); return…
-
0
votes0
answers92
viewsHow You Configure Checkboxes Materialize Css in Asp.Net MVC Web Application
How do I set up Checkboxes in the Asp.Net MVC Razor Since in the documentation we have the following configuration Materialize for checkboxes <p> <label> <input type="checkbox" />…
-
0
votes1
answer41
viewsWPF - Trigger elements within a wrap panel
I have a wrap panel that contains several dockpanels, and I need each dockpanel to change its background by hovering over it. I don’t think creating a Rigger for every element would be appropriate.…
-
0
votes1
answer18
viewsC# Foreach Xpathnavigator add the same values
I have recursive xml, I want to add the xml values to context but in the xml example it adds the Utilities right but when it arrives to add Functionalities, it adds only the values of the first…
-
0
votes1
answer74
viewsI can’t change the form code C#
Could you guys help me out? Well, I’m using C# with SQL Server database, I have a form with two codeCdd fields and descricaCdd both text type, I can include and delete data from these fields without…
c#asked 7 years, 11 months ago Lucas Barbosa Fonseca 27 -
0
votes1
answer142
viewsC# Entity Dbset with DDD?
I have an app C# MVC with DDD and in the repository I’m making the call like this: return DbSet.Include(i => i.Cliente).FirstOrDefault(a => a.ProcessoId == processoId); DbSet-> is in the…
-
0
votes1
answer59
viewsHow to make text remain txt in full Unity
The idea is to create an entry where the user enters data and is registered in txt and can add other data as a simple schedule. The screen asks: type your name: Please enter your age: Enter your…
-
0
votes1
answer61
viewsGet image from "Resources" folder from android
Good morning, I have an android app made in C# via Xamarin. In this application, there is a report made in HTML that is displayed in a Webview. This report needs to display an image (PNG) that is…
-
0
votes0
answers25
viewsWhy does Linqpad say a network directory exists, while . NET does not?
I have a network directory on "\\10.88.0.1\rec". However Directory.Exists returns false while debugging in visual studio. This is strange since the LinqPad returns true. Are there any differences…
-
0
votes0
answers23
viewsHow can I work with files in network directories on . NET?
How do I access files present in network directories on . Net? Accessing local files is simple, I can do Directory.EnumerateFiles("C:\\", "*.*"). But Directory.EnumerateFiles("\\\\10.88.0.1\\rec",…
-
0
votes1
answer245
viewsAzure connection drops constantly
I’m using Visual Studio 2015, C# and database SQL Server Azure and developing a project Windows Forms. Everything works perfectly, only when I spend a certain time without running my application to…
-
0
votes1
answer182
viewsConsultation in Relationship Many-to-Many with LINQ to Entities
I created a database that has two tables called Teachers and Courses. A teacher can teach many courses and a course can have many teachers. I created the table Undergraduates to relate both. When…
-
0
votes1
answer89
viewsxml being generated with encoding="utf-16"
I’m having trouble serializing an xml, the same is being generated with encoding="utf-16". But the xsd is with encoding="utf-8", how I make it to be generated with utf-8? var xml = string.Empty; var…
c#asked 6 years, 1 month ago João Bosco 41 -
0
votes1
answer127
viewsUse Droid project class in PCL Xamarin Forms
How do I use a class that was created in the project Droid in the PCL ? I created a new class that will save the image in a folder in the project, but I need to call this class PCL. My class:…
-
0
votes0
answers46
viewsEntity Framework is inserting duplicate to each Savechanges
Hello, I am using a technique to be able to insert many entities in the database, I am using C#, Entityframework and SQL server. Example List<Editora> editoras = new List<Editora>();…
-
0
votes1
answer81
viewsError while disconnecting from Postgresql
I am trying to make an application in C# using SGDB Postgresql, but always when I close the connection gives the following error: Undefined object reference for an object instance. I’m using the…
-
0
votes2
answers160
viewsIcollection<Object> - how to create and use objects within the collection
I am working on a project using MVC5 and Entityframwork 6. I followed a tutorial to create a database from my templates. Example of a model: public class Side { public Side() { } public int ID {…
-
0
votes1
answer204
viewsInclusion of files in Visual Studio projects
Good evening. I wonder if it is possible to include a file in a Visual Studio project by programming at runtime ?…
-
0
votes1
answer44
viewsHow to create "options" in Select from a spreadsheet?
I wonder if it is possible to generate options dynamically in the selection by C#? For example, I have my selection : <select id="Selecao_itens" multiple="multiple" runat= server size="3"…
-
0
votes1
answer866
viewsHow to catch the current day
How do I display the current day in a program? But I didn’t want to take the zero left. For example: the day 01 I want to be 1, the day 02 I want to be 2.
c#asked 6 years, 1 month ago Guilherme Wayne 167 -
0
votes1
answer69
viewsHow do I manipulate and submit data through GET and POST?
I have a web application and need to access an external url that has login and password. Later I must fill out a form, submit the data and receive the feedback in my application! This is possible…
-
0
votes1
answer52
viewsHow can I break lines from an Errormessage of a Data Annotation?
I have this property and the Data Annotations for it: [Required(ErrorMessage = "Campo orbgiatório.")] [RegularExpression("^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$", ErrorMessage = "The password must…
-
0
votes1
answer21
viewsHow to expose only a few table columns in a Webservice via SOAP?
How to expose just a few columns of in a Webservice ? Example: I need to expose just the Name and Surname table: public class Cliente { public string Nome {get; set;} public string SobreNome {get;…
-
0
votes0
answers415
viewsInterrogation instead of C# and SQL Server accentuation
Good afternoon guys, I have a C# application with SQL Server database, the problem is that words that have accented letters, in place of these letters appear lozenges with a question mark in the…
-
0
votes1
answer88
viewsError running Add-Migration Setup
When executing the command Add-Migration Setup for the creation of the table in SQL Server in PM the message below occurs even if I reference the api project with Shared. The system even processes…
-
0
votes1
answer82
viewsComposite Component in C# does not show all attributes
I have a system where I use a dataGridView to list the fields of a table through the property dataSource, and a textBox so that the written text serves as a filter (when I type something in textBox,…
-
0
votes1
answer60
viewsRun Event Textbox c# WPF
I have a Textbox and need that after pressing the right mouse button and clicking paste, it do a check, I tried to use various methods like TxtTexto.PreviewMouseLeftButtonDown+= new…
-
0
votes1
answer69
viewsHow to block the application from minimizing C#
Guys, I have a windows form app that after opening a new screen it’s minimizing alone and I’m not able to figure out why. All the screens I call as follows Home PagHome = new Home(); PagHome.Show();…
-
0
votes1
answer156
viewsHow to send Partialview input to a controller?
I tried to find something that would take away this doubt, but there’s nothing concrete for what I want. I’m using Visual Studio 2015 and MVC 5 and Razor in my project. I have a form (Create) with a…