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
answer129
viewsName of a Role with accent in the Identity database
The need to create a Role with emphasis on the table of Roles of Identity in the database: "Technical". My question is whether this can generate further problems, perhaps at the time of checking…
-
1
votes1
answer973
viewsList of View objects for controller
I have two Customer and Address entity where the customer has multiple addresses. At the time of completing the form, the user can add two addresses in the same form and at the time of Submit, I…
-
1
votes3
answers860
viewsIs it possible to call the same method in all Controller Asp.. net mvc without having to repeat the code?
In my Controller Home, I have this: /// <summary> /// Aqui estou trocando o idioma da página de acordo cam a seleção do /// usuário. /// </summary> /// public ActionResult…
-
1
votes1
answer53
viewsSearch for objects in Runtime
I have an application that will make simultaneous downloads of different data sources. I have a DataGridView that will receive the result of a select and from the amount of lines that come from that…
-
1
votes1
answer27
viewsWebclientdownloadfiletaskasync file in use, even with Dispose
I am downloading 10 images at the same time async way, However in the 2nd photo usually the error that the image is in use. The process can not access the file because it is being used by Another…
-
1
votes1
answer1548
viewsHow do I Google a search with C#?
I need to search for any term in Google and get a list of the results of this search. I’m trying to do this using the Google Custom Search API but I’m not getting satisfactory results. For example,…
-
1
votes0
answers157
viewsSome questions with the Microsoft Sync Framework
I’m thinking of implanting the Sync Framework in a solution that I am developing, but I have had some doubts about the functioning of the Framework, I hope you can help me, I’ll be very grateful.…
-
1
votes0
answers287
viewsConversion error in Restsharp Deserialize method
I have a method that consumes a Rest and then deserializes using a class. It was working, but maybe by changing the return made appear the error. My method is like this: public void LoadPedidos() {…
-
1
votes1
answer1071
viewsInjection of Depension with Ninject C#
I am developing an application that has 4 layers Dominio, Infra, Servico e Web When I have access to a route for example Home/Index he says that there is no constructor without parameters, my…
-
1
votes1
answer430
viewsError "max res 25, Skipping mipmap-anydpi-v26" - Xamarin Forms
am having the following error while running my app in Visual Studio 2017: max res 25, Skipping mipmap-anydpi-v26 I searched here on the Internet and found nothing that could help me solve it. Does…
-
1
votes1
answer189
viewsCall Partial with Ienumerable within a page that has its Ienumerable Asp.net mvc?
In my layout I have an option where I show some notifications, to include in the layout a partial : @Html.Partial("_PartialNotificacoes") @model IEnumerable<Generico.Dominio.TB_NOTIFICACAO>…
-
1
votes0
answers82
viewsList a restaurant, from the item that is saved in the database, within a table Cart
I would like to list a Restaurant, where items from this same restaurant have been saved inside the cart. When saving the product of the cart, it pulls with it the ID of the restaurant. Follow my…
-
1
votes1
answer525
viewsButton making Submit for action instead of opening only Modal
I am riding a Modal to add a category and a list of products in a modal. When I click the button to add a new product my category Create action is called when I should just open the modal. I do not…
-
1
votes1
answer799
viewsSend view to controller values by jquery
I am making an application in . Net C#, and wanted to do an input and a button that sends the information to my controller for jquery/ajax, and I have no idea how to accomplish this, I need to pass…
-
1
votes1
answer410
viewsUsing the Reportview
I’d like some help. I’m using the ReportView to generate a report from id passed as parameter: public ActionResult Relatorio(Guid id) { LocalReport relatorio = new LocalReport(); //Caminho onde o…
-
1
votes0
answers133
viewsScheduling form with multiple items that need to be rented at the same time
I need to make an agenda to register: The information on scheduling Register multiple instruments at once with scheduling information The button Buscar cliente pulls the data(Client ID and Name)…
-
1
votes1
answer64
viewsHow to create a Privatefontcollection
I have some fonts that are not standard Windows, so I’m creating a PrivateFontCollection but I’m having a hard time. These sources are used by the entire program, so I thought I’d create a Classe…
-
1
votes2
answers110
viewsBlock using and Exceptions
Is there any way to report code errors in the block using as in the try we have the catch? Or using the using I’m stuck with a plethora of if, else if and else? Supposing that the block using force…
-
1
votes1
answer178
viewsDisabling Unfilled Textbox
I’m developing software in c# to count the number of electronic anklets that go inside a box. This box has room to store 40 anklets. In the case of Software I put 40 txtbox where each one represents…
c#asked 8 years, 1 month ago Luiz Felipe 57 -
1
votes1
answer29
viewsC# - Add Mousehover to each Button in a Flowlayout
How do I add a Mousehover event to each existing button in a Flowlayoutpanel? I want that when you hover the mouse on each button in this Panel the mouse pointer changes to "Hand" and that the…
-
1
votes0
answers50
viewsCOMPUTER VISION - MULTI-TARGET TRACKING
How to track people in images and video. I would like you to tell me efficient Apis or libraries that perform this task. I wish for a result similar to that video. Well I’m running the risk of…
-
1
votes1
answer122
viewsGood Practices for Moving JSON Object
I have a grid (Kendo ui MVC) today has 35163 lines, and I need to create a button to export the contents of the grid to CSV. I thought I would do something like this, the moment I load the…
-
1
votes1
answer122
viewsSimple doubt of C# in Unity
I don’t know anything about C#, but I’m trying to develop a simple project in Unity. It consists of moving a crane. I made the code to move the bridge, but if I keep holding the button it keeps…
-
1
votes1
answer517
viewsVisual Studio Form Covering Windows Taskbar or Getting Behind Taskbar
I have an application that uses the property Formborderstyle = None, however this happening that in windows 10 my status bar (statusBar) that is at the bottom is behind the taskbar and windows 7…
-
1
votes1
answer55
viewsUnrecognized Element (Download Files)
I am trying to make a code to download the file in a folder and returns me this error unrecognized element. Code: string pasta = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)…
-
1
votes0
answers47
viewsHow to send combobox data to a DBMS sql server?
I have an application where one of the formularies contains a comboBox with data entered from the property Item (Collection). How to send data that is in this comboBox to a sql server database ?…
-
1
votes1
answer3869
viewsHow to add a line at the beginning of dataGridView C#
I am developing a Tetris game in Windows Forms, I have programmed the movements of all the pieces, now I have to erase the lines that are painted completely. To remove a line I use the code:…
c#asked 8 years ago Rodolfo Souza 163 -
1
votes0
answers30
viewsHow to define characters to use when creating a salt
I need to generate a salt, but I need all characters to be part of a list of numbers and letters. string usedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; Gero the salt…
-
1
votes0
answers29
viewsProperty Mask does not appear
The Mask property does not appear in the text box. I’m using Visual Studio 2017.
-
1
votes2
answers258
viewsUse of struct in C#
I have to record customer information. And I used struct to do this. Is it worth doing this? It is or is not a good practice?…
-
1
votes1
answer118
viewsIs it possible to use the Entity framework from a class library?
Normally I use the Entity framework in an MVC project but I would like to know if I can use it from a class library project
-
1
votes2
answers254
viewsHow to close all the Forms I want in C#
Let’s say I have 4 presses: form1, form2, form3 and form4. Knowing that the window form1 will always be opened first and when I give a .close() in form2 it, along with the others, must close. How do…
-
1
votes1
answer127
viewsUsing Simpleject with Class Library
I am beginning in the use of simpleject for dependency injection. I created the Bootstrapper class to register containers: public class BootStrapper { public static void RegisterServices(Container…
-
1
votes1
answer484
viewsError "The name "Initializecomponent" does not exist in the current context" in every Xamarin project.
Out of nowhere, ALL my projects are making the mistake The name "Initializecomponent" does not exist in the current context (CS0103) When created. I don’t need to change anything, the error comes…
-
1
votes2
answers129
viewsRegister an "admin" user when running the c# mvc application
good afternoon, I need some idea for a web system to automatically create a user Admin as soon as I run(open) the application. that is, when running the application with a zeroed database, so that I…
-
1
votes0
answers60
viewsHow to get Excel formula in C# using Oledb?
I need to get the formula contained in an Excel cell. I am using Oledb to access the spreadsheet, I wonder if you have how to use it to access the formula of a cell?
-
1
votes1
answer60
viewsCompress a file saved in Database
good afternoon! I have a file that is saved in bank, and I need to zip this file, when you download it. How do I do it? Thank you very much for your support
-
1
votes1
answer1107
viewscapture selected item Javascript created dropdownlist
Someone could help me. I have the following problem I have a Textbox and a Dropdownlist, in the textbox there is an autocomplete with state names; after finishing the textbox fills Dropdownlist with…
-
1
votes1
answer58
viewsAdd platform to Xamarin project already created
I started a project in Xamarin.Forms a priori only for Android and UWP and did all the programming in the Portable project. Is there any way I can insert the iOS project so that the modifications of…
-
1
votes0
answers370
viewsDynamic input reading in C#
I am developing a solution in Winforms C# that receives a text file via network, via HttpWebRequest: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(conexao + "/piece.txt");…
-
1
votes0
answers66
viewsExcel with password for editing
I am mounting an Excel file where I Gero an array of bytes and the UI downloads the file in xlsx format, I need to open this file with password to perform edits, there is a way to do this right in…
-
1
votes3
answers223
viewsimplement Ixmlserializable interface in a class
I have a class and need to implement data serialization and deserialization in an XML structure using IXmlSerializable, for this in my class I have to implement the methods, GetSchema(),…
-
1
votes2
answers221
viewsSaving checkbox information in TXT files
I’m developing an O.S. software where I’ve divided the main problems into several checkboxes. All data populated on the screen will be sent to a text file, which soon after will be viewed by the…
-
1
votes1
answer665
viewsPrinting with Printdocument, Printpreviewdialog C#
I’m trying to print labels of my products straight from my app. However I am not able to reduce the size of the paper in the printing, for this reason I’m losing 1 label every 1 impression I make,…
-
1
votes1
answer1283
viewsHow to take the name of a variable within a method?
I need to access the name of a variable within a method. Example: public class A { public A() { string nameToWrite = "thisdoesntmatter"; B.GetName(nameToWrite); } } public class B { public static…
-
1
votes2
answers107
viewsInsert with monthCalendar in Mysql and C#database
I need to make a insert of the date with the monthCalendar in C# in the database MySQL, only that the format of the date of MySQL is (yyyy-MM-dd) and I’ve already modified the code : I modified the…
-
1
votes1
answer198
viewsControl time to return timeout
Look at the scenery: I have a procedure that running directly by SQL it takes about 50s to return the data. However, when this same process is executed via the system, the timeout in 15 s. My…
-
1
votes2
answers51
viewsSet Dictionary to constant
Follow the code below: var values = new Dictionary<string, string> { { "tipo1", "dada65d" }, { "tipo2", "546541354765321" }, { "tipo3", "klwoiqyhalwtbfowh" } }; How can I declare the class…
c#asked 6 years, 5 months ago Matheus Miranda 5,375 -
1
votes1
answer671
viewsASP.NET CORE Dependency Injection
I have a situation that I don’t know how to solve. I have the following scenario: I have an ASP.NET CORE Webapi and a Class Library also in . NET CORE. Since the class library will be according to…
c# dependency-injection asp.net-core class-libraryasked 6 years, 5 months ago Vinícius Avansini 183 -
1
votes1
answer691
viewsASP NET MVC 5 Dapper with SQL Server?
I’m creating an app with ASP.NET MVC5, DAPPER, C# And SQL SERVER. The problem, is that in the data listing, is bringing the empty fields, except the ID field, which comes zero (0). If anyone knows…