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
votes2
answers312
viewsMetodo Post Angular
Hello, I am developing an application using as Backend ASP.NET C#, and with front Angular5! I’m doing a post method for the first time and it’s not flowing well! In Backend I have a method as…
-
0
votes1
answer168
viewsHigh box input in Asp.net
I am creating an application in MVC with DDD and on my registration screens, I would like the fields string as NomeCompleto, Endereço, Cidade, etc, were saved on displayed in inputs in high box. I…
-
0
votes1
answer47
viewsc# - Tableadapter - Delete
Good afternoon, I’m new in this area. I have to create the Include, Change and Delete buttons of a sales system. I’m using the tableAdapter and already managed to make the Include button gives this…
-
0
votes1
answer510
viewsSql Server Fluent Nhibernate Connection
I’m having trouble configuring connection to Sql Server database I have this connection method but give me this error message when running the application public static ISessionFactory CriaConexao()…
-
0
votes0
answers65
viewsHow and where to call the method of creating a Token in the Webapi to perform the validation of my user?
Good night! I’m doing a user authentication using HMACSHA512, but I’m having a hard time calling the authentication method at project start and in my controller (I’m using .NET). I did it in . NET…
-
0
votes1
answer76
viewsIntegrating API in c#
I would like to pass the result of this API to a TextBox. I’m having a hard time getting the information from this class to the graphic part. using System; using System.Collections.Generic; using…
c#asked 6 years, 7 months ago Marcos Wilian 13 -
0
votes0
answers186
viewsHow to update a table using mysql c# and a method?
You can use a method or class that uses table fields to update this table? For example: update record field 1 with f(record field 2 1), record field 1 with f(record field 2), etc...…
-
0
votes1
answer49
viewsDoubt about methods
I am learning by the book Use the Head and in it there is the following code to do an exercise of random items public class Menu { public Random Randomico; string[] Carnes = { "Rosbife", "Salame",…
-
0
votes1
answer827
viewsStreaming video with C#
I need to create an application that will receive video streaming from multiple cameras in real time, as in a security panel where you can monitor what happens through the cameras (as in a…
-
0
votes0
answers51
viewsIs it possible to run a Windows executable stored in memory?
I have an executable that is not an . NET Framework Assembly stored in a byte[], and I intend to run it without creating a file dedicated to it for security reasons. The reason you don’t want to…
-
0
votes0
answers25
viewsError while restoring Windows Forms Application Database
I am creating the database backup but cannot restore. It shows the following error: this is my code to perform bank restore to my application. try { var _with1 = openFileDialog1; _with1.Filter =…
-
0
votes0
answers490
viewsEmail Confirmation in C#!
I made this form that the user when registering should receive an email in which will have a link to confirm your email by clicking on the link, so the way I did it is not receiving the confirmation…
-
0
votes1
answer1082
viewsCombobox.Selectedindex does not return the item in Windows Forms
I have a program in windows Forms and I need to select the item in a combo box so that the user can edit the record, however, it receives the value, finds the index but does not return the selected…
-
0
votes2
answers228
viewsAsp.Net MVC - Selecting item from a Dropdownlist reflects the same selection in another Dropdownlist that contains the same selection items
I have 02 Dropdownlist fields that have the same items to be selected, this is: Camera 1 Camera 2 Camera 3 Camera 4 Camera 5 Camera 6 Summarizing in great part of the registrations that will be…
-
0
votes2
answers289
viewsRead xml file ready
Eae guys, I am trying to read an xml file in my program, but it has a line that I am not able to read. <?xml version="1.0"?> <XML> <PATCHINFO> <PATCHNODE file="./Unit1.dfm">…
-
0
votes1
answer32
viewsWhy does my Endereco model return null after the postback?
Why did my model Addressee returns null after the postback?: Model: public class Paciente { public Paciente() { Endereco = new List<Endereco>(); } [Key] public int PacienteID { get; set; }…
-
0
votes1
answer211
viewsCascade and Composite Dropdownlist MVC
I have one question I have 1 User class and composed by other classes Gender, Course and Semester Ex public int Id { get; set; } public string Nome { get; set; } public Genero Sexo { get; set; } =…
-
0
votes1
answer546
viewsURI problem 1061 - C#
I have a problem that the code below it results me the correct result, however, when I send to the site it informs the error RUNTIME (vector or array with less capacity than required for the…
c#asked 6 years, 6 months ago Lukas_Russo 11 -
0
votes1
answer237
viewsHow to add elements in Queue (Queue) continuously?
Below I have a code that he needs to do the following: Create a thread, then start it. When starting the thread, according to the time (random time) the program adds a value in the queue, after…
-
0
votes0
answers148
viewsC# Replace parts of String in txt file
Hello. I’m studying C# and I’m struggling with a function. I have an array, like below, where each node contains an id, a Pattern(regex) and a value for replacing the part of the string that matches…
-
0
votes1
answer3217
viewsAssemblies not found for Visual Studio
Hi, I’m working with Visual Studio It’s the first time I’ve come across this message while trying to debug the program: "C: Program Files (x86) Microsoft Visual Studio 2017 Community Msbuild 15.0…
-
0
votes0
answers40
viewsno Overload for method Sendkeys takes 1 argument
Why am I getting... no Overload for method Sendkeys takes 1 argument using System; using test2.Selenium; using System.Collections.Generic; namespace test2.ExtensionMethods { public static class…
c#asked 6 years, 6 months ago Daniele Melo 1 -
0
votes1
answer82
viewsReturn Json with Xmlhttprequest
How to popular a table with a JSON using XMLHttpResquest POST? Jquery var xhr = new XMLHttpRequest(); xhr.open("POST", "/EnvioEmail/PlanilhaPaciente", { area: "Sistema" }, true);…
-
0
votes1
answer30
viewsBuild VSTS with error (Missing an Assembly Reference)
Has anyone ever had this error running build on VSTS ? I have a project C#, that runs locally and can publish on the server. I tried to check in the project on VSTS, to automate the build and always…
c#asked 6 years, 6 months ago Herbert Giacomini 1 -
0
votes0
answers26
viewsAutomatically generate procedures with table-type field in Entity-framework
I am trying to generate an existing database for Entity-framework 5,I managed to generate without problems,with all relationships in this database I have procedures that receives as parameter a…
-
0
votes1
answer67
viewsEntity Core, in relationships
In my project I have two models: student and occurrence. In the routine of registering/editing a student, this quiet, however, in the routine of registering an occurrence, I do not know why, Entity…
-
0
votes1
answer73
viewsDiscover Xtrareport element page
In my application, I am generating a report through run time with methods like this below, where print on the screen a label. How could I find out on which page was printed such label? I need to…
-
0
votes1
answer102
viewsWhere de query using multiple list properties
I have the following scenario public Teste[] GetTestes(List<TesteDTO> testeDTOs){ IQueryble<Teste> query = GetAll<Teste>(); //where ... } public class Teste() { public int Prop1{…
-
0
votes1
answer95
viewsHow to inherit a form in c#?
I have an application with the form FormFuncionario. I wish to inherit all the features of this form for a second class, called ControlFuncionario, where it will be responsible for holding various…
-
0
votes1
answer56
viewsDefinition Isfirstrowascolunmnames not existing in Iexceldatareader of Exceldatareader reference
Using Visual Studio 2017, I installed the reference packages through Nuget Exceldatareader Ecxeldatareader.Dataset version 3.4.0 I am following a tutorial on how to open XLS file and is giving error…
-
0
votes0
answers44
viewsserialize an array and pass as parameter to model
My Action: public JsonResult SalvarCadastro(ListaModelView model) { } My Model: public string Assunto { get; set; } public string Mensagem { get; set; } public List<ContatosEmailModelView>…
-
0
votes0
answers249
viewsHow to change a specific text from a txt file?
In my notepad has 2620 lines which is the maximum. >PRODUTO [1] 1. Exemplo de texto 1 2. Exemplo de texto 2 >PRODUTO [2] 1. Exemplo de texto 1 2. Exemplo de texto 22 >PRODUTO [3] 1. Exemplo…
-
0
votes0
answers59
viewsRun a FOR on Webbrowser C#
I am currently trying to develop a data capture application using the WebBrowser of C#. I can get the application to enter the page and enter the value and click on search, but I can’t link this…
-
0
votes1
answer104
viewsWindowsforms - C# - Reportviewer - "Full HD Resolution" Remove Edges
I am using the Report Viewer, the data appears normal, but appears a blank border on computers with high resolution as FULL HD for example. Code for loading the form. Properties of the report. I…
-
0
votes1
answer258
viewsFileupload is not passing the file to Code Behind
I am doing some tests to Upload any file and save it in a physical folder, but even with the file loaded on the screen, it is not passing in ID/value: Example: Follows codes: aspx: <div…
-
0
votes0
answers88
viewsSql Server Database Modeling
Good morning friends, I have a project that has basically two types of products, the simple products, such as market items, rice kg, beans 1 kg , etc.. and items composed as basic baskets , formed…
-
0
votes1
answer338
viewsHow to detect version of Windows OS?
I want to get a value of what system you’re using, like: Windows 7 or Windows 8 or Windows 8.1 or Windows 10 How can I do this in C# ? I’ve tried System.Environment.OSVersion doesn’t work right. I…
-
0
votes1
answer77
viewsI cannot use Jsonconverter in Json.Net with Unity
So I’m developing a visual programming system in FSM, and for serialization, I used Json.Net, until then, all right, it worked correctly, however, I had to serialize UnityObjects And things got…
-
0
votes1
answer139
viewsGrouping in LINQ with multiple entity records
I have a LINQ query that averages a list of Notes grouped by risk sources. var mediaControles = await (from ac in _context.AvaliacaoControle join c in _context.Controle on ac.ControleID equals…
-
0
votes2
answers589
viewsHow to list only the name of existing folders in a given directory
How can I list only the name of a folder that is inside a root folder? Example: Pasta raiz C:/Downloads SubPastas: Teste/ Teste 2 In my DLL I can list the folders but with its full path, I would…
-
0
votes2
answers703
viewsquote and quotes in a string (leaving " or #39; in the View)
I’m trying to put the following text in a string, but I can’t... when I can’t find the wrong double quotes in the arroba... I’m going crazy. Can someone help me? ,{ "@type": "Listitem", "position":…
-
0
votes1
answer48
viewsHow to give a POST on the page with the UPLOAD property without going into looping?
Looking on the internet I saw some websites saying that when you own a property Upload on the page can not give POST the same because it goes into looping. I have an application that creates/deletes…
-
0
votes1
answer29
viewsHow to create file at runtime?
In my application, I need to convert a string that contains XML for RTF. The way I found to accomplish such a task is with the following code below, which uses files instead of strings. Then I would…
-
0
votes1
answer96
viewsHow do I display all the columns of my BD Asp.net mvc
wanted to know how to loop when printing the columns of my grid with the values of the database, but it displayed only 1 result even the database being huge, here the code, thanks for the help…
-
0
votes0
answers77
viewsHow to inject dependency into a dynamically created class?
I’m doing a gateway to a client project consuming Microservices. In this gateway, the way the client will consume the application is through an interface. The implementation of this interface will…
-
0
votes1
answer121
viewsHow to make Generic with 2 C#classes
Good night, I’m having trouble using Generics in C#, I’m a programmer Java and I’m learning to use C#. I want to use Generics in a class in the package Service, I am implementing the class referring…
-
0
votes1
answer77
viewsOauth with Dependency Injection
Hello, I’m starting my studies with Oauth, and right away I came across a problem. I created the famous 'Startup' class, and in it I call my predecessor as follows: public partial class Startup {…
-
0
votes0
answers58
viewsZxing Colorful . net
I need to create a color qrcode using zxing.net however I can’t and I can’t find 1 tutorial on the internet even searching and trying for days, Does anyone have any idea how to develop 1 color…
-
0
votes1
answer118
viewsShorten/Camouflage very large text within a grid
I have this grid line that takes the description of a message, but it is very large sometimes and is breaking the grid layout, I wonder if it is possible to shorten the message and/ or camouflage…
-
0
votes1
answer699
viewsSend Json from client application and receive on Server
I have a problem sending a json from my client application to my server API. Json is generated correctly, and the POST request is made, but on the server side the following error is reported:…