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
answer46
viewsValue is not added to a variable within a function
I’m doing a simple quiz show with questions and answers, with punctuation. My problem is this: I made a function so that every time the answer is right, +1 will be added to the score variable.…
-
1
votes1
answer404
viewsFullcalendar C#
I would like to open a modal when clicked on a day in the calendar. script: <script> $(document).ready(function () { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center:…
-
1
votes1
answer718
viewsProblem with winppla.dll
I’m developing a solution for an Argox printer, so I downloaded this example to see how it works: http://www.argox.com/wp-content/uploads/largedriver/Command%20Library%20V410.zip The example can be…
-
1
votes0
answers43
viewsHow to change the treeview + image c# . net
I want to change the treeview, follows the example below. In the image above to see what the + I am disproportionate to the name, I would like to change the size and together the design of +,…
-
1
votes2
answers122
viewslistbox with database records
With this code I create an item in the listbox with the id number, I would like it to create an item for each id record you have in the database. Database: Mysql Code: UWP C# using (_connection =…
-
1
votes0
answers226
viewsProcess.start() does not start another application correctly
Hello. I have a solution composed of three applications. One of them is a Windows service (Boardservice.exe). Another is a Windows Forms application that opens a presentation screen and creates an…
-
1
votes1
answer39
viewsNewtonsoft catch part of JSON
I’m working with C# and I want to take part of JSON returned by request PostAsync and this is the return of REQUEST: {"meta":{"status":422,"error":true},"error":{"status":1102,"msg":"Invalid email,…
-
1
votes1
answer56
viewslistbox item (UWP)
With this code I add items to listbosx with the amount of record I have. How to have a check before to know if the entry of that record has been added and not act item with the same id number?…
-
1
votes1
answer35
viewsData in listview (uwp)
how to display the information of a Mysql database record in a listview? I tried it but it didn’t work. using (_connection = new MySql.Data.MySqlClient.MySqlConnection("Database=teste; Data…
-
1
votes0
answers129
viewsiTextSharp PDF coming blank
Good afternoon guys, I have the following code: public void GerarPDF(long id) { string HTMLemString = RenderizaHtmlComoString("~/Views/item/item.cshtml", id); var regex = new…
-
1
votes2
answers1974
viewsRead specific XML tags?
I need to do the reading of tags specifics of that file XML: <?xml version="1.0" encoding="UTF-8"?> <EnviarLoteRpsEnvio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
1
votes1
answer478
viewsRead Tags with the same name in XML
I am with the following example XML file: <?xml version="1.0" encoding="UTF-8"?> <EnviarLoteRpsEnvio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
1
votes1
answer148
viewsConvert Query SQL Server to Entity Framework
How to convert a SQL of SQL Server for Entity Framework, Ordering field values as follows: of: ({'115-F-G', '10 -H-G ', '98 -T-R'}) for: ('10 -H-G ','98 -T-R','115-F-G') SELECT * FROM ReportePedido…
-
1
votes1
answer425
viewsGet href HTML attribute in C#
I have the following code in a Razor view: <div id="HTMLreturned" class="row"> @Html.Raw(ViewBag.HTMLreturned); </div> <script> var nrLinks = 0; $(".enlacesMas >…
-
1
votes1
answer418
viewsHow do I go through the Firefox Insecure Connection alert page with Geckodriver?
How to pass certificate error screen (insecure connection) with Geckodriver Firefox Webdriver? I’m hitting a URL that displays this alert. I already added in the browser exceptions, but the problem…
-
1
votes2
answers151
viewsHow to create Function in Database with Migrations Ef core?
I created a Function in Postgresql and would like it to be generated together with the database in the initial Migration. I tried it this way and I didn’t get any results protected override void…
-
1
votes1
answer200
viewsDropdownlist filled and selected
I need to fill in a @Html.Dropdownlist() with my Model parameters and pre-select one of the items. At Model I am receiving the complete package, being: List of products on Produto and the items…
-
1
votes1
answer135
viewsSystem.Argued tofrangeexception how to solve?
Hello, I am getting an Exception when I run the code below stating that my List<> is out of range. I have tried everything, but without success. How do I solve? private List<string>…
c#asked 5 years, 3 months ago Willian Silva 21 -
1
votes0
answers332
viewsGeolocator Plugin Xamarin
I need to get the current location of the user’s device and with this to help me I am using the Geolocator Plugin of Xamarin, I can get the current location normally on my smartphone but the Google…
-
1
votes0
answers44
viewsInvokemainthread Xamarin
I’m having a problem invoking a Uithread on PCL. I made a method like this: private void PopularConteudo() { Task<List<Departamento>> taskDep = new…
-
1
votes1
answer104
viewsIs it more correct to use the Master-Detail concept?
I have a situation that I would like to use the most correct (elegant) way to implement. The scenario is as follows: I’m building a Helpdesk system where Tickets are stored in one table (and…
-
1
votes1
answer33
viewsPassing data between partitals Views
I have a huge form, it was broken using partial view, created the following doubt that I could not remedy in google, if these views are all of the same control, as I pass the data of partial view To…
-
1
votes1
answer393
viewsHow to create composite key in Mongodb
How can I create composite key in Mongodb and use in C#?
-
1
votes0
answers79
viewsWhat is the best way to do database replication?
I have an application in WPF + MS ACCESS where users register, query, etc. The main server is located in SP, but we have branches in RJ, BA, MG, PR, RS, GO, etc, which also access the tool. Due to…
-
1
votes3
answers341
viewsSetting Focus() in Usercontrol Textbox
I have the following Usercontrol : public partial class SliderChrome : UserControl { private int _min; public int Min { get { return _min; } set { txtmin.Text = _min.ToString(); } } } I use this…
-
1
votes1
answer821
viewsReferences Visual Studio Code
From a while to here Visual Studio Code gave an updated and since then for each variable I create appears this "0 References" on top, and it turned out to be something pretty polluting to my eye.…
-
1
votes1
answer306
viewsHow to enable Migrations using Entity Framework Core = Windows Forms C#
I am testing EF Core in a Windows Forms project following the DDD standard. In the repository layer I created my context and in my domain I already have the Models classes defined. How do I enable…
-
1
votes1
answer1244
viewsOptional Entity Framework include
I have a great deal of doubt here about Include of the Entity Framework. var ocorrencias = db.Ocorrencia .Include("Pessoa") .Where(c => c.Id > 1000).ToList(); I used the Include, because I…
-
1
votes1
answer79
viewsHow to locate 2 matches that are interspersed with the same regex
In the following string: 83/80/95 I need you to find 83/80 and 80/95, using the same regex. I am using the following regex: (\d{2,4})[\/](\d{2,4}) The first Match "83/80" is found, but the second is…
-
1
votes0
answers16
viewsImplementing dummy to windows form
i’m in a project trying to find the best way to implement an Interactive dummy to a windows form software. I think the tools on visual studio aren’t good enough to do so. Any suggestions of…
-
1
votes2
answers528
viewsWhat does the error "Cannot implicitly convert "void" to "int" refer to?
My goal is to calculate percentage, while trying to run the code below I get the error message: "Cannot convert type implicitly void in int. As I correct? int var1 = Console.WriteLine("Insira…
-
1
votes1
answer40
viewsHtttpurlconnection functions missing in Xamarin Forms development (Java System Conversion to C#)
I have a system developed in Android Studio and am passing to Xamarin Forms in C# and this happening some errors that I am not able to solve Summarizing what my system does: It takes the html page…
-
1
votes1
answer56
viewsincrement field with lambda
I need to insert an increment into a field that is the primary key of a table, but need to be selected by one more field and does not work, if use only with the primary key works. But I need to pass…
-
1
votes1
answer136
viewsMigration with Strange Characters?
The data is from a bank Firebird and even opening with official tools the characters do not come in the "format" br, for example: ÁGUA vem µGUA PÃO vem PÆO Find a website that provides a special…
-
1
votes0
answers53
viewsI cannot call print method () and pass serial port instance
In summary: this object variable _serialPort of Form1 I want to use in the Print Class and in the other Form: Config_serial : Form public partial class Form1 : Form { static SerialPort _serialPort;…
c#asked 5 years, 1 month ago Gilcecler Carneiro 49 -
1
votes0
answers89
viewsas it is possible after the user is dropped from the system by inactivity, the same return to the same screen that was after login
As I am new and I am learning mvc, I would like to know, as it is possible after the user is dropped from the system by inactivity, the same go back to the same screen that was. I know the code…
-
1
votes0
answers185
viewsHow can I change scenes in Unity while maintaining the current characteristics and values of my player?
Good afternoon. I have a project at Unity in C# to practice here, and I have the following difficulty: My player will have some bool variables and an inventory of items that I need to keep when…
-
1
votes0
answers40
viewsHow can I make a monitoring system?
I’m developing a platform for a company, and I’ve come to a question that, if solved, can help me make the platform more robust... How can I make the system (MADE IN VB.NET OR C LANGUAGE#) that…
-
1
votes1
answer116
viewsForeach of a Class properties and display in the View
I have a view on Asp.net mvc as follows var Maquina = Model.ListMaquinas; @Html.DisplayNameFor(x => Maquina.Property1 ) @Html.DisplayNameFor(x => Maquina.Property2 ) ... @Html.DisplayNameFor(x…
-
1
votes0
answers264
viewsPowerpoint.dll (HRESULT exception: 0x80010001 (RPC_E_CALL_REJECTED))
Error description: Component COM Class Factory Recovery Failure with CLSID {91493441-5A91-11CF-8700-00AA0060263B} due to the following error: 80010001 The call was rejected by the call. (Exception…
-
1
votes1
answer395
viewsC# String.Contains() does not work, not even string search derivatives
I have a method in my code that looks for a person’s name inside a string but always returns false. Even when the name exists inside the string. What is totally inexplicable. I tried using Contains…
-
1
votes1
answer231
viewsHow can I convert datetime to data string?
Follows the code: var fullEntries = dbContext.tbl_EntryPoint .Join( dbContext.tbl_Title, combinedEntry => combinedEntry.entry.TID, title => title.TID, (combinedEntry, title) => new { UID =…
-
1
votes1
answer279
viewsCreate similar C# dictionary in Typescript?
I have the following dictionary in C#: Dictionary<string, List<string>> ls = new Dictionary<string, List<string>>(); ls.Add("chave1", new List<string>());…
-
1
votes1
answer535
viewsProblems reading all lines of an Excel with OLEDB and C#
I am developing a program to import spreadsheets Excel with language C#, using the component OLEDB, when importing a spreadsheet with 100547 lines the program can only read 54046. Follow the source…
-
1
votes1
answer428
viewsSave Token to User Machine
I made an integration with the GoogleDrive and by doing all the authorization on the consent screen, it creates a token in the appdata user, however I put this application in Azure in a VM. Only…
-
1
votes1
answer428
viewsConsuming web api with various models
In that question of mine Doubt Verb GET Webapi I face some mistakes because of relationships. But now taking it as a basis on account of my models, how could I consume this service? Because the…
-
1
votes2
answers120
viewsC# MVC how statements work
I have the code below, and to call the Session that stores the user data, only once I want to put it in the controller statement. Doubt The variable usuarioLogado is by request or it may happen that…
-
1
votes1
answer151
viewsDynamic matrix in C#
What would be the best way to create a dynamic square matrix ? An array that increases row and column as elements appear to be inserted into the matrix I found some comments on the internet saying…
-
1
votes1
answer171
viewsHow to keep option after refresh - Asp.net
I have a select, some options and a jquery code that in select change, updates the screen with the data of the chosen option. The question is, how do I maintain the option after window.Location?…
-
1
votes1
answer664
viewsBug in the build?
What a mistake when I compile my application? Severity Code Description Project File Line Suppression State Error CS1061 'Blankpage1' does not contain a Definition for 'listView_SelectionChanged'…