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
votes0
answers566
viewsError with Entityframework preview
This is the message that is returning in the browser The Entity Framework Provider type 'System.Data.Entity.SqlServer.Sqlproviderservices, Entityframework.Sqlserver' Registered in the application…
-
0
votes1
answer183
viewsc# Silent install from localDB
My program needs Sqllocaldb.msi to run. I already downloaded this file and put it on the CD that I will distribute the program. The question is: Is there any way to make my setup.exe run this…
-
0
votes0
answers55
views[UWP][C#] How to stop the announcement of a service on the local network (unregisterService on android) with the Windows API.Networking.Servicediscovery.Dnssd
The problem I am encountering is that I am not being able to delete a dns-sd service from the local network. With the Registerseservice method the dns-sd service is created correctly, but I do not…
-
0
votes1
answer188
viewsError using bootstrap with ASP.NET MVC
I have the error when using bootstrap.min.js, the error is that it does not find a function. It follows error below and configuration of my system. You need to post something else so you can help me…
-
0
votes1
answer93
viewsHow to compile software through a website?
I’m making a website where one can create software through it. But my question is: How to do this in an automated way? The proposal would be that the software would be made in WPF and the code would…
-
0
votes1
answer121
viewsList does not load database data with Xamarin.Forms and c#
I created a list by code and I can’t load the data. I made this list by xaml and also not and I have another that works(xaml) and tried to do the same and nothing. When I go up the list appears:…
-
0
votes1
answer61
viewsReturning to the main page when accessing an invalid url
As I redirect the user to the main page of the application, in case it tries to access a url invalid. For example, www.teste/teste.html, in case the page does not exist then system directs the user…
-
0
votes1
answer148
viewsFluent API Zero-to-one Relationship 0-1 - Bringing Results From Another Relationship
I’m trying to make the relationship between my Cliente and the CieloToken, tried with Fluent API and Data Annotation, I mixed them together and it didn’t work. In fact it executes, but even if the…
-
0
votes1
answer559
viewsFire method 5 seconds after execution of previous
How to set a timer so that after 5 of sending the command EnvDados the sending of the command NovoEnvio, this within the same method? IPAddress[] IPs = Dns.GetHostAddresses(host); Socket s = new…
-
0
votes2
answers379
viewsListview with an empty and editable column
People wanted to have empty and editable cells in a column of a Listview that pulls from the SQL Server Database information to my project. To pull the information I use LINQ and I can list all the…
-
0
votes0
answers39
viewsLogin to Kooboo CMS admin with Active directory
I am in a project where the client wants the login in the CMS admin to be done through Active Directory. The CMS we are using is Kooboo based on aspnet MVC. Has anyone ever done anything like this?…
-
0
votes3
answers1957
viewsCannot implicitly Convert type 'Object' to 'int'. An Explicit Conversion exists (are you Missing a cast?)
I’m trying to develop a code in my game but I’m making this mistake. ... case "cpsuser": Console.Write("Digite o apelido do usuário: "); string Nickname = Console.ReadLine(); Console.Write("Digite a…
-
0
votes0
answers365
viewsChange the console source
In the picture below, I can change the console font by clicking on the top of the window and clicking on properties: But how can I change the font and font size of the console through programming?…
-
0
votes1
answer199
viewsSystem.Indexoutofrangeexception Sqldatareader
Hello, I am trying to make a code read what is in the SQL Server Database, but I have this error: System.IndexOutOfRangeException: Pontos em…
c#asked 7 years, 2 months ago Leonardo Araujo 55 -
0
votes2
answers57
viewsNot changing the page when changing the page
When I try to go to page 2, it shows the site loading, but only brings me the first page information of my page 1. My Controller: public ActionResult Index(int? page) { IList<Abastecimento>…
-
0
votes0
answers21
viewsLocal Proxy Server - C#
Recently I had contact with an application called Burp Suite. The application provided a local proxy server on a specific port (127.0.0.1:8080), and, if I used this proxy server in my browser all…
-
0
votes1
answer28
viewsHow to work with Datagridviewcheckboxcolumn in c#?
I’m having some difficulty working with the data grid view selection field, I tried to do it this way: public void Atualizar() { Stock obj = new Stock(); for (int A = 0; A < dgv_Entrada.RowCount;…
c#asked 7 years, 2 months ago António Mateta 159 -
0
votes2
answers3813
viewsHow to truncate decimal in X decimal places?
I am using the following code, but when sending ex:'10.100' to 2 houses it returns '10.1', but it should be '10.10' public decimal TruncarDecimal(decimal value, int decimalPlaces) { decimal…
-
0
votes2
answers391
viewsWhat’s the Where for?
I’ve seen it in several C# codes Where, but I didn’t understand about him. What is algumacoisa.where() in the C#? When should I last? What good is?…
-
0
votes1
answer75
viewsHow to change Backgroundimage location in windows Forms
I have a Picturebox object that has an image set and behind it I put a background but I can’t change the background position pb.ImageLocation = Directory.GetCurrentDirectory() +…
-
0
votes0
answers76
viewsSet a default value in Dropdownlistfor
In the form I have a: @f.FormGroup().DropDownListFor(r => r.AtividadeId, Model.AtividadeList).WidthLg(6) listing all activities to perform a filter per activity. I want to put an option: "List…
c#asked 7 years, 2 months ago Rafael Christófano 365 -
0
votes0
answers148
viewsHow to use Constraintlayout in Xamarin
Hello, I would like to know how to use Constraintlayout in Xamarin for Android, use Visual Studio Community 2017. I’ve installed the Nuget packages, I’ve updated my Android SDK, I’ve set the minimum…
-
0
votes1
answer116
viewsDynamic method for opening screens
I am creating a method to open any screen I pass in the parameter. I did this method: public async Task NavigateTo(Page page) { await App.MasterDetail.Detail.Navigation.PushAsync(new page()); } But…
-
0
votes2
answers41
viewsConnect to SQL with Appconfig
How can I connect to SQL with connectionstring in Appconfig? I did so, but I wish it could be for Appconfig, how can I do? private void button1_Click(object sender, EventArgs e) { string…
-
0
votes1
answer432
viewsHow to map a List to another List?
How can I map a list from one type to another list of another type ? I’m getting an object list of type public List<DetalheViagem> DetalheViagems { get; set; } And I need to move the valuables…
-
0
votes1
answer64
viewsRelationships with the Entity Framework?
Next, I’m modeling the domain class of a system and I’m having a hard time understanding certain things from Entity Framework, so I hope you can help me, aiming that I’m following the idea of Code…
-
0
votes1
answer366
viewsHow to load the latitude and longitude pairs to a C# object and work them?
Good night! I’m developing a web page where the user can plot a route. I use the google maps api. I need to take the latitude and longitude pairs of the route, press for an object c# and, after…
-
0
votes0
answers236
viewsIgnore files from the Debug obj folder
I’m having a problem, every time I check in the visual studio relates these files : I created a file (.tfignore) to try to ignore them but it didn’t work : \packages \obj \bin \_design\.sass-cache…
-
0
votes0
answers140
viewsConvert path C: to C:
I am trying to take the path that is stored in the bank and open by the explorer, and for that I used the code below path =…
-
0
votes1
answer304
viewsDisable action on mouse move C#
I have a problem in my code, I have some actions on mouse moves in C# and would like to disable them. Whenever I drag the mouse to the listbox of my form, it already does the action, I would like to…
-
0
votes1
answer136
viewsError editing record more than once with Entityframework C#
When editing a record and saving for the first time entityframework performs the update successfully, but when I click again on edit and save the record I come across the following error: Error…
-
0
votes1
answer2285
viewsHow can I check if all textboxes are empty?
Code: if (string.IsNullOrWhiteSpace(txtNumero.Text) && string.IsNullOrWhiteSpace(txtTitle.Text)) { MessageBox.Show("Preencha todas as informações"); } I tried to do with && and it…
-
0
votes1
answer836
viewsWhen you click the form 2 button update form 1 label
How can I pull the label from Form1 to form2 to label. Refresh?
-
0
votes0
answers559
viewsError creating controller using Entity
In my Employee Registration project I have the following folders: MODEL CONTROLLERS DAL VIEWS From the moment I create a controller using the Entity that already creates me right my view he makes…
-
0
votes1
answer68
viewsDetermine the time of execution of the next task based on the end of the current run in Windows Service C#
This is my problem. I have an application as a windows service that needs to run 15 seconds after the current job execution is finished. The task basically performs database operations and may be…
-
0
votes1
answer68
viewsHow to split a file line without using Substrings in C#?
I created a file where I store data row by row as morada|nome|telefone|nif, that is, each variable saved in the file is divided by |. I remember there being a method of dividing this line into 4 to…
-
0
votes1
answer182
viewsChange Primarykey Entityframework
How to change a Primary key using Entityframework? I have a table with simple PK and need to change this PK by Entityframework.
-
0
votes0
answers149
viewsError 407 when connecting in proxy
I am trying to communicate with a web service and my machine uses internet via proxy. When initiating web service communication, proxy authentication error. How can I get the user and password I use…
-
0
votes2
answers860
viewsHow to install Assembly Microsoft.ReportViewer.Processingobjectmodel 12.0.0.0 in GAC?
I am using Visual Studio 2015 and my project uses Reportviewer, but when I export my application to be installed on my client’s computer it informs me this message: I have searched all day on the…
-
0
votes2
answers219
viewsService to pick up a change in the bank
Here’s what I need. As I do for a service to auto startar whenever the flag of the bank changes from 0 leg 1. I have a field in a table in the BD(Sql Server), that every time the seller request a…
-
0
votes2
answers131
viewsError while trying to add an auto-incrementable column to a datagridview
I’m trying to add a column self-adjusting in a datagridview but I am not able to figure out what is missing to work properly. My program reads the data from a database table and displays in a…
-
0
votes1
answer329
viewsQuantity Inventory Management
Personal I am trying to do a stock control, my idea is when I consume a product it changes in the table. Ex: Estoque: Produto / Quant Caneta /5 Papel / 10 Lapis / 20 But when I separate these items…
-
0
votes1
answer50
viewsDifficulty with Regex
I have the following content in a string: |1300|11349|03042016|10857,000|0,000|10857,000|444,470|10412,530|25,530|0,000|10387,000|…
-
0
votes1
answer155
viewsA timer for a service read a table in the comic book
I need to get a service to read a table in the comic book every 5 or 10 seconds. I don’t see any other way to do that. When in this table a certain Flag is changed, then the service pushes a message…
-
0
votes0
answers36
viewsConnection error in the Connection string
Hello, trying to connect my VS to Mysql by string connection I get every time error that the server was not found, as I should proceed? private void btnCadastrarConfirmed_Click(object sender,…
-
0
votes1
answer401
viewsMVC error 404 POST method
This is my controller: [HttpPost] public ActionResult TestePost(int id1) { ViewData["Teste"] = "O método POST funcionou, você digitou: " + id; return View("Index"); } [HttpGet] public ActionResult…
-
0
votes0
answers195
viewsOpen contextmenustrip when right-clicking on the items displayed in the listbox
I tried this way: private void listBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { contextMenuStrip1.Show(listBox1.PointToScreen(new Point(e.X, e.Y))); } }…
-
0
votes0
answers206
viewsThere is no vs_setup.msi file, as I do
I use VS2017. The option Other Project there is no. I had to download an extension, install, in order to have this option, because I am doing a windows service and I will need to install this…
-
0
votes1
answer70
viewsGet BD (Mysql) Rows - Webservice Mysql C#
I’m having a hard time getting Rows. It recognizes no variable within the cmdMySQL (@Login). I tried to put other but nothing if I take the @Login and put the value of email who is in the comic book…
-
0
votes1
answer1720
viewsAssign href via jquery
I have an element in my Layout and I’m trying to set href via jquery, but it won’t. The condition is in my index. Follows the code: Layout <div class="three wide column dindex"> <div…