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
-
1
votes1
answer843
viewsError running Dropdownlist on ASP.Net MVC
I’m having the following error when turning: System.Invalidoperationexception: 'There is no 'Ienumerable' Viewdata item that has the 'Sexoid' key'.' Follows code below: Model: [Required(ErrorMessage…
-
1
votes2
answers116
viewsHide Menu tab
I am trying to hide the Nav menu bar when it enters a specific form, would be to give some example? This is the index of my form: @using PagedList.Mvc; @model…
-
1
votes0
answers136
viewsFixed - Problem with a Web Api calling another Web Api
I am beginner developing for web environment and I am with a very bizarre problem, so the text should stay long to try to explain it. I have the following scenario: A front end made in Angular that…
-
1
votes2
answers65
viewsProblem with variable connection to C# Visual Studio Database
I have my connection string that takes the connection variable from App.Config static String string_conn = ConfigurationManager.ConnectionStrings["bd1"].ConnectionString; However I put a function…
-
1
votes0
answers438
viewsError Inserting: Incorrect integer value 'EXAMPLE' for column 'id_example' at Row 1
I am trying to insert into my mysql database through Visual Studio 2017 - C# (localhost-wamppserver) but it is giving error. The first column of the table records is the id_record which is the…
-
1
votes0
answers46
viewsProblem to sector setImageResource
Hello, I have a project to which I upload drawable images to a Listview, the problem is that when I run the project no seated images appear, someone can help me find the error? LAYOUT main_activity…
-
1
votes1
answer664
viewsGet return from url c#
I need to get a return from an ajax that I send. The URL returns something like:…
-
1
votes0
answers51
viewsEntity mapping with . Net Core 2
have the following entities: public class Transacao : IEntity { [Key] public int Id { get; private set; } public int LojaId { get; set; } public virtual Loja Loja { get; set; } public int…
-
1
votes0
answers36
viewsRegistration with repeated fields, how to do?
I have a register in the system that I am developing that will have repeated fields, I would like to get help in this implementation. This screen is called Sequence which has the following fields…
-
1
votes1
answer1374
viewsLeave Selected specific item Combobox C# Winforms Visual Studio 2017
I am developing an application that contains a customer register. In this register there is a ComboBox listing the cities in the database. My question is this: How do I leave 'setate' the name of a…
c# winforms visual-studio visual-studio-2013 visual-studio-2017asked 6 years, 5 months ago user59669 -
1
votes2
answers717
viewsRun command as Admin c#
I’ll get right to the point! I have a C# application and need to execute a command in Cmd with Admin privilege. I need to activate SQL Server if it is stopped. public List<Atendimento>…
c#asked 6 years, 5 months ago Matheus Oliveira 11 -
1
votes0
answers17
viewsPass gridlist informationForm1 to another gridlist in form2
Good morning, I am cracking my head to add a row of a grid from my Form1 to the grid of my form2. Below follows my code to simplify my doubt. ItemVendaView item = new ItemVendaView() { ProdutoID =…
c#asked 6 years, 5 months ago Carlos Henrique 29 -
1
votes0
answers28
viewsI need an HDF5 Dataset Attribute to be a string
Good afternoon, I’m trying to create some attributes for my datasets, I was able to create the attributes but at the time of setting their values (strings) I’m not getting, I tried several different…
-
1
votes2
answers456
viewsString Field List Sorting
I have a List with attributes, of which I have the field of reviews, containing: Excellent, Good, Regular, Bad, and Bad. The information for this field I get from the consumption of a REST API using…
-
1
votes2
answers343
viewsCombobox slowing form loading winforms C# visual studio data
Good evening, I have a question. I have a customer register that lists cities in a combobox, only every time I open the register it loads the data and this slows the loading of the form, there is…
-
1
votes0
answers60
viewswpf application with Entity framework does not work on another machine
I have a wpf application with Entity framework and sql server express...works perfectly on my pc, but when I try to install it on another computer it does not work...the application does not create…
-
1
votes0
answers71
viewsError in passing json value from web api to ngfor
This is the error you are making when calling the api. think this is something in exiting the api or receiving it in my other project? ERROR Error: Cannot find a supporting differ Object '[Object…
-
1
votes0
answers43
viewsGoggle APIS with C# via proxy
I’m trying to connect in Google drive through Google.But here in my service has proxy and when I try to get the credential it gives error requesting proxy authorization. (opened browser accessed a…
-
1
votes1
answer83
viewsAdd Dropdownlist value to the database
I wanted to put a dropdownlist in my view where his List value went to the database, but I only know how to add values to DropDownlist with data from a table, wanted to make a DropDownlist with…
-
1
votes1
answer58
viewsListview Item Xamarin Forms being opened 2 times Custom Controls
When displaying my list and clicking on an item, it opens 2 times the same item page. public class DeliveryViewModel : BaseViewModel { public ObservableCollection<Delivery> Delivery_Col { get;…
-
1
votes1
answer724
viewsConvert Time 24 hours to 00 hours
I have an int account, I need to return it for hours, and it is working perfectly, the error occurs when the time appears 24, and it should appear 00:00. Go on like I’m doing: string horaStg;…
-
1
votes2
answers387
viewsExport Database Table to XLSX without Interop
In the code below was assigned a Query for the variable sQuery. I need to somehow export this Query for Excel using some resource available to C# Webform other than Interop. Dim da = New…
-
1
votes0
answers21
viewsProgressiring is not shown
I need to show the progressringduring the execution of a task, but it does not appear and the screen is frozen until the execution of the task. private async void btn_Criar_Click(object sender,…
-
1
votes1
answer53
viewsProgress bar for procedure stored in c# windows form
I have a project that updates data through a stored procedure (delete, Insert, update) with a long duration not determined. I would like to present a progress bar with time not determined during the…
-
1
votes1
answer123
viewsManipulation of records (regedit)
I have an application developed in windows Forms that handles some records in the following way: "HKLM SOFTWARE MINHAEMPRESA etc...". This application was run as an administrator and I never had a…
-
1
votes2
answers65
viewsWhen placing a class in Dbset using Migrations
I have the following classes: public DbSet<Request> Requests { get; set; } public DbSet<Answer> Answers { get; set; } where they have a one-to-Many relationship. When I want a class to…
-
1
votes1
answer139
viewsHow to get string from Enum on an ASP.MVC grid
I have the following: public enum RegiaoEnum { CENTRO = 1, NORTE = 2, SUL = 3, SUDESTE = 4, CENTROOESTE = 5 } And the following View: @using MeuDominio.Enums; <div class="animate"> <table…
-
1
votes1
answer63
viewsCrud with Mongodb and C# error in type or namespace
Accompanying a Macoratti tutorial here, errors appear in three types. I don’t know what to add to solve. I Copy and Paste and gave error. Below the code: using MongoDB.Driver; using System; using…
-
1
votes1
answer238
viewsAudio file conversion . Wav to . Mp3
I would like help, I have the following situation. I have a web application in which to return an audio file according to the requests. However (I believe) because these audios are of format . wav I…
c#asked 6 years, 5 months ago Victor Augusto 43 -
1
votes1
answer29
viewsError trying to update data in Asp.Net MVC - db. Entry(Lada) application. State = Entitystate.Modified
I am having problems at the time of editing, more specifically in the lines below, db. Entry(Lada). State = Entitystate.Modified; db Savechanges.(); the update that precedes the lines above, occurs…
-
1
votes0
answers36
viewsHow to use Graphdiff Entity Framework Code First
I have the following tables in my database: Sale Detailing Productsresulture Plots The relationship is as follows: 1 Sale => N Detail 1 Sale => N Productsrelations 1 Detail Spreads => N…
-
1
votes0
answers64
viewsOauth Authentication doesn’t work in Azure Function
I created a webapi selfhost and used Oauth to generate an authentication token, it worked as a console application but when I try to create a function in Azure it only return server error(500) My…
-
1
votes1
answer52
viewsHow to make the console output appear in a textarea in Windowsforms?
I would like to know a way in which the output of my project, appear in a textarea in Windowsforms. I need this because my system is a binary number converter, and I want you to print out the…
-
1
votes1
answer55
viewsHow to take the Schema of a Model in a Dbcontext made in the Entity Framework Core
Hello, I’m starting to work with Efcore and I’m doing an Override on the method SaveChanges() so that whenever there is a manipulation of the bank I can log this manipulation. My problem is that I…
-
1
votes0
answers70
viewsElastic transactions with MS SQL Server
Considering the following code snippet: using (var scope = new TransactionScope()) { using (var conn1 = new SqlConnection(connStrDb1)) { conn1.Open(); SqlCommand cmd1 = conn1.CreateCommand();…
-
1
votes0
answers120
viewsHow to declare a ternary condition in XAML as a parameter for a Custommarkupextension
Hello I’m starting to work with WPF and created a Custom Markup Extension leaving of this tutorial. The intention of this Markup Extension is to simulate the declarative conditions that are found in…
-
1
votes0
answers52
viewsReport in Report View type Master-Detail
Dear collections, I am developing a report through the Report View type master-detail. The data source of this report will be a text file. Almost done. The problem is at the moment of transferring…
c#asked 6 years, 5 months ago Gilberto V. Gonçalves 43 -
1
votes1
answer234
viewsHow to turn a JSON into a table/paged list using . Net Core MVC?
I’m studying API access and I’m using the Github API. I want to make a screen in which it is possible to search by name the repositories that match the criteria passed. But Github’s results are…
-
1
votes1
answer320
viewsPost by Postman is giving error of Object Reference not set to an instance of an Object
I understand that the Frombody is coming null and I don’t know why. That’s my Postman payload { "ChannelCode" : "TS", "Name" : "Teste", "Celphone" : "(11)999999999", "Endpoint" : "www.teste.com.br",…
-
1
votes0
answers109
viewsConvert Publish JAVA key encryption to C#
I need to send a hash encrypted in c# but the API so me this possibility in java, has how to follow this logic and apply in C# ? try { try { cipher = Cipher.getInstance("RSA/None/PKCS1Padding",…
-
1
votes1
answer1160
viewsHow do I capture text from a web page with Selenium?
I need to create a standard People Generator using the site https://www.4devs.com.br/gerador_de_pessoas with Selenium. That’s the code I have for now: [TestFixture] public class GeradorDePessoas {…
-
1
votes2
answers1554
viewsMask CURRENCY {en-BR} in Gridview C#
My problem is: I want to include a mask with the Brazilian currency in a column of GridView. I’m using the CultureInfo.CurrentCulture, but when I put to turn, in the GridView only the first…
-
1
votes1
answer789
viewsThe operator "==" cannot be applied to operators of type "string" and "long"
Hey, good night, man. I’m doing a job for the college in C# and I don’t have much experience. I went to run the program and the error described in the title appeared. The piece of the code is this:…
-
1
votes1
answer37
viewsc# - uploading file to ftp works only the first time
I have a function that sends files to an ftp, the first time I use it works perfectly, but when I use it for the second time it gets stuck on the line: using (Stream Writer =…
-
1
votes1
answer1106
viewsConvert double to string keeping the same format
I need to convert a value of type double for string in C#, without this value being changed to scientific notation. my code is: double valor1 = 0.000024746578864525161; string resultado =…
-
1
votes1
answer127
viewsHow do you expect a bool to stay true?
I have this method async currently waiting for a time declared by me. The program first restarts the boolean result and then send commands to a serial that after a certain time returns in my program…
-
1
votes1
answer616
viewsASP.NET MVC error circular reference when serializing object
Good afternoon dear comrades! I am a beginner in ASP.NET MVC and in C#, I am developing a project and I found a problem. Basically, it’s a store registration system. I have two tables, one called…
-
1
votes1
answer97
viewsProblem with matrices
Well I’m starting to study the language C#, I have some experience in Java, in java we have a certain problem in matrix manipulation, because, although there is no pointer in the language itself,…
c#asked 6 years, 5 months ago Gelson Lopes do Nascimento 11 -
1
votes0
answers118
viewsWhy is it that when I change scenes, Dontdestroyonload doesn’t work?
I have a gameObject with the script with all the information about the level, Xp and etc for the game. It is loaded into the scene Loader, when I switch to the next scene, I don’t want to miss this…
-
1
votes1
answer207
viewsHow do I not map a Class with the Entity Framework
I’m making my first system (C# ASP MVC 5) with Entity Framework and Migrations. I have my classes mapped correctly and migrated to the Database that is SQL Server 2012. But the question is how I can…