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
votes1
answer2137
viewsThe method or operation is not implemented c#
I cannot identify the reason for this mistake, since I made other developments with this logic and it worked. The method or operation is not implemented. Follows code: Method that starts the values:…
-
0
votes1
answer753
viewsView PDF document windows Forms
Is there any property of viewing a file . PDF from the event Click on Picturebox without having to create a new modal? Example: I have this Picturebox, where I created the code below, as soon as it…
-
0
votes1
answer59
viewsProblems Inserting Image on a Button
I’m having trouble inserting an image of the "Packiconfontawesome" package into a button. I installed the Icons package of Mahapps and referenced in my view, only an error appears as the image…
-
0
votes0
answers30
viewsHow to migrate TXT file to Webservice?
Good staff I have this code: public static string filePath = Path.GetTempPath(); public static void ImportFile(string path, string fileToRead) { if (!File.Exists(path)) File.Create(path).Close();…
-
0
votes1
answer248
viewsHow to move a window using a button? c#
I have an application in WPF that has no borders or background, it’s just a stylized button with an image and a frame, but I would like it to be possible to move it. My current code is like this:…
-
0
votes2
answers743
viewsMicrosoft Visual Studio 2013 - There were compilation errors. Do you want to continue and run the last successful compilation?
Guys, here’s the deal: I’m developing a program Windows Form for desktop in the C# using the Visual Studio 2013. However, sometimes when I click on iniciar/ start some project compilation errors…
-
0
votes2
answers818
viewsC# Convert Dataset to JSON
I need to convert a Dataset into a JSON in order to recover in the View. The query there is just an example, because it is a large query. I’ve seen things like: string json =…
-
0
votes1
answer50
viewsWhen saving PDF file spaces are replaced by "%20" (without quotation marks)
I am using Interop to create a word document and at the end save it in PDF, everything goes well except the file name, and I used this path to save it. var NovoDocumento =…
c#asked 6 years, 10 months ago user100754 -
0
votes1
answer376
viewsError adding view in visual studio
Hello, I’m starting in Asp.net mvc and I’m having this problem when adding a view, would anyone know what this error is about? Error: There was an error running the Selected code Generator:…
-
0
votes1
answer74
viewsI can’t open my grid view link
I made the following code <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ID_PTD" DataSourceID="SqlDataSource1" EmptyDataText="There are…
-
0
votes1
answer133
viewsAsp . Empty Net Dropdownlist After Form Submit
I own a dropdownlist which is dynamically filled after two textboxes have been filled in. When I do form Ubmit the dropdownlist is empty, even if dynamically filled. Dropdownlist…
-
0
votes1
answer296
viewsQuotation marks exiting in incorrect JSON format!
I’m creating a dictionary for JSON on Razor Pages, but the quotation marks ("), are coming out as " _Layout.cshtml (UTF-8) ... <body> ... <script type="application/ld+json">…
-
0
votes0
answers32
viewsUdpclient not receiving
I tried to make a local chat program using Udpclient, no exception is thrown, it just doesn’t get the message (I’m running 2 equal). My code: public class UdpSenderReciver { int Port = 9600; private…
-
0
votes1
answer218
viewsTwo Foreign key in the same EF column
I have a question, I am programming with . NET MVC using the Entity Framework. At the moment I have: class Produto { public int ProdutoId { get; set; } public string Nome { get; set; } public string…
-
0
votes1
answer2819
viewsHow to get values from the selected line in gridview by clicking the button
I need to make sure that when selecting a line and clicking the Approve button, the button takes all the values of the line and plays in a variable and then delete the line this and the code of my…
-
0
votes0
answers90
viewsSignalr Cannot read Property 'Myhub' of Undefined
Good afternoon, I am trying to apply the Signalr library on a Master page site in Webforms . aspx, but I am having error reading the Hub file. I can’t get the site to see such a file. I’ve run on a…
-
0
votes0
answers82
viewsModify database access data in the app.config file after running the project’s "Publish"
Hello, I created an application in C# and for access to the database I did the following procedure: In the app.config file I created the following: <add name="MyDatabase"…
-
0
votes1
answer830
viewsHow do I make a field mandatory?
I am mounting an Engineering Management Application(Consoleapp) p/college... I would like to know how to make mandatory the entry of the fields Name/Surname/CPF/dataNascization when the user is…
-
0
votes0
answers503
viewsPass json format parameter to consume service post in app Xamarin.Forms
In my App I have this method to consume the service post (still writing the method): public async Task<string> PostIndicador(string jsonValue) { client = new HttpClient(); string url =…
-
0
votes2
answers230
viewsListview with first column exceeding limit
Hello! I made a form using the library Materialskin In this library there is a component called Listview (which would be similar to Winforms' Listview) that the first column gets bugged. Look at…
-
0
votes1
answer311
viewsHow to format a field with ASP.NET Webforms C#
I need to format Textbox <asp:TextBox runat="server" id="txtValor" MaxLength="20"></asp:TextBox and I’m having a lot of difficulty, first this grid is open in a modal, I mean, when I create…
-
0
votes0
answers113
viewsMy app aborts when trying to consume Rest
It has a Rest service that my android App needs to consume. For this I have to send a parameter in json format. It turns out he aborts the moment he consumes the Service. That’s the code I have for…
-
0
votes1
answer53
viewsHow to pass a value to a list and make it static?
I have a list of objects that I am filling it in as follows: var props = type.GetRuntimeProperties(); var obj = new T(); for (int i = 0; i < readerCache.Count; i++) { var prop = props.Single(x…
-
0
votes1
answer42
viewsConsole validator
Good evening, I need to program a user validator in C# (I have visual studio). Console style. I need from a list . txt the value of "id=" in the URL to be changed.…
-
0
votes0
answers53
viewsWhich is faster? Looking for data in the bank or reading a cookie?
Guys, in your opinion, what would be better in this situation? I’m working on an Asp MVC and Entity Framework website. I have a table of federative units where I have (simplifying) 3 columns Id,…
-
0
votes0
answers145
viewsWebsite slowness when using Signalr for notifications
Good morning, I’m developing a website to run in local intranet format on IIS. With technologies asp.net ADO in format WebForms, I’m using the library SignalR to monitor a simple table on SQL Server…
-
0
votes0
answers38
viewsException sqlite in windows 8
I’m getting this Exception when trying to open a window inside a program I made, the program was done in visual studio 2017, with sqlite 3, it opens normal only from this problem when trying to open…
-
0
votes0
answers77
viewsCalling a page via ajax Angularjs
My code ajax: $scope.CarregaMenuPrincipal = function (data) { var req = $http({ method: 'POST', url: '/Home/Index',data:{usuario: data.usuario },}) .then(function (response) { response; }, function…
-
0
votes0
answers47
viewsInsert with composite objects
get this json { "Name": "Teste", "ExpirationDate": "/Date(1515703416000-0200)/", "Program": { "Id": 1 }, "Resource":{ "Id": 1 }, "InsertDate": "/Date(1515703416000-0200)/", "InsertUserId": 8,…
-
0
votes1
answer443
viewsUsing SQL Query with Asp MVC5
how do I execute an SQL query with ASP MVC5 + Entity? Example, I need to use "Count" in a table called "templates" am dev php and am learning now Asp.net framework mvc 5 and have no idea how to do…
-
0
votes0
answers102
viewsGenerate PDF Reportview
I took an example (/a/256234/90835) to generate PDF of a report. The Example worked, but I have other reports that need to pass parameters, if I put only to view in Reportview with the parameters…
-
0
votes2
answers146
viewsHow to associate items from a String list to the code name of a C#label?
My goal is to play a hangman’s game. Basically my problem is this: I have a word divided into substrings for each letter of the word, all stored in an array. For example: string[] letras = new…
-
0
votes0
answers67
viewsWrite an XML using Xmlwriter C# from an Excel table
Hi, I’ve never used Xmlwriter before, this is something totally new to me. I have a table in an excel and need to create an XML file from it, the first column will be the main Node, and each other…
-
0
votes0
answers55
viewsHow to write from the popup to the parent page?
I am in doubt in the following situation, I am returning a PDF to the popup (Page son). I would like to close this Popup and Write(pdfDoc) on the parent page) //A propriedade ContentType especifica…
-
0
votes1
answer44
viewsHow to return a message warning that there is already a record?
I have a method in Cepcontroller Register that before making the registration makes some validations and between them, checks if there is already registration for that Zip Code. I would like to…
-
0
votes0
answers81
viewsWrite to a listbox in another form
Good stack. I am developing a small application for automatic backup of Mysql and SQL Server databases. The application is to be made in Windows Forms + C#. I thought to implement something similar…
-
0
votes1
answer51
viewsHow to organise data
Good. I have a question, not so much about code with data organization. I have a small automatic backup application and the idea was to have "a task programmer", where I indicated the time, the type…
-
0
votes1
answer42
viewsEntity Framework bank creation
I’m new to Entity and I’m following a step by step to create a Code First application ( http://www.entityframeworktutorial.net/code-first/simple-code-first-example.aspx ). I created the application,…
-
0
votes0
answers34
viewsError Request Mail
Could someone give me a hand here? I’m doing an environment check to send a certain email, only the following error is occurring. Could you tell me how to fix this? My code is below public void…
-
0
votes0
answers31
viewsDatagridview does not store information in the table
I have a datagridview that is powered by a search in a database to carry out a sale but I can only sell one product at a time because the sales table cannot receive 2 or more products simultaneously…
-
0
votes0
answers97
viewsimplicit Conversion (varchar to varbinary) not allowed, use the CONVERT
I’m trying to make a system that obtains images and saves them in a specific database, but I can’t solve this error (I’ve already applied CONVERT to SQL but it hasn’t solved). (Error area) //Aqui…
-
0
votes1
answer220
viewsGet the value of custom attributes in aspnet-Identity . NET CORE 2.0
I’m using the Identity with aspnet core 2.0 and I needed to add the attribute nuCPF on the table Applicationuser. In the controller I am getting the user data as follows: [Controller:…
-
0
votes1
answer47
viewsHow to call an "Admin" role in an IF in C#?
Guys I created several roles for me to do an access control. So I want to know how to call the admin role so I can pass it in an if, like example I’ll put below in my _layout: @if ("Aqui que eu…
-
0
votes0
answers183
viewsHow to not freeze/lock the application when querying data via SQL Server and create a "progress bar"?
The code below as an example brings me great information from the database. Every time I click on the "Search" option of my program, my application freezes/hangs for a while until the select "pull"…
-
0
votes1
answer71
viewslimit users in the database
I searched and did not find how to limit users in a DB... I am making an application in C# using 'sql server' and I would like to know how to make the userDB has a maximum of 5 users, when trying to…
-
0
votes2
answers111
viewsType convection error
Trying to record in a sql table an image, its name and description and some foreign keys to allow me to search later. On execution I get error of string conversion for Int 32. But all fields in the…
-
0
votes1
answer85
viewsSqlite Visual Studio 2008
I am trying to work with Sqlite in Visual Studio 2008 to make a system for Windows Embedded Compact 7. The problem is that it always gives the following error: A first chance exception of type…
-
0
votes2
answers284
viewsVS 2015 SOAP does not work, but in Soapui works normal
In the company there is a Service available through Webservice SOAP (IBM BPM). I can’t get an answer on VS 2015 using the Web Reference a connection with this service. I always get the answer after…
-
0
votes1
answer61
viewsFluent api - Map table to another table with the same key
I need to know how to map in the Fluent API the following item public class ImportacaoHeader { public string IdImportacao { get; set; } public DateTime dataInicio { get; set; } } public class…
-
0
votes1
answer2095
viewsHow to verify that "DLL" files was successfully registered
I need to check if the process has been run successfully, in case the extensions it will try to register are: .DLL .OCX The Code I’m using to register is this: string pathcli = copiar + nomedofonte;…