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
answer122
viewsProblem to save content C#
I’m trying to make a replica of the notepad, in the part of saving content in richTextBox1.Text I’m having the problem: System.IO.Ioexception:"Process cannot access file 'file path' because it is…
-
1
votes1
answer82
viewsNullreferenceexception when trying to write to database
I have this error, when I will record the form data in the database. Error: System.Nullreferenceexception: System.NullReferenceException ocorrido HResult=0x80004003 Message=Referência de objeto não…
-
1
votes1
answer132
viewsStored asynchronous Procedure
When trying to run Process asynchronously public async Task<ActionResult> Index() { Stopwatch watch = new Stopwatch(); watch.Start(); ContentManagement service = new ContentManagement(); var…
-
1
votes2
answers395
viewsTreating JSON in C#
I have a return of an HTTP request in JSON format. It comes as follows: { "message": "authenticate" } It’s a simple return, but I’m a beginner in C# and would like to know how to assign only the…
-
1
votes1
answer960
viewsBrowsing between Pages
I’m making a sales order app with Xamarin, but I am with a problem, in flame ruma page search, and return the selected value to the page I was. I will explain further below. Screen 1: Order…
-
1
votes2
answers102
viewsCompare date field with current date in datagridviwer
I got a field in my datagridiviwer which is called "SCHEDULE" this field receives a date, which comes from the database as varchar or string, I need to compare the date in this field with the…
c#asked 7 years, 1 month ago Junior Guerreiro 617 -
1
votes1
answer334
viewsAmbiguity error after changing Resource (ASP.NET)
I have been working on an ASP.NET MVC project for months. It is a system available in English and Portuguese, English being the default language. I do this through the use of Resources, and it was…
-
1
votes0
answers31
viewsRequest status after browser close
I have an Asp.Net MVC project and I realized that when I close the browser immediately after the beginning of a request (without waiting for its due ending), it makes somehow the server does not…
-
1
votes0
answers102
viewsHow to receive automatic notifications from Pagseguro?
I am implementing in the company where I work, the payment with Pagseguro. So far, I can generate a payment request and also receive the transaction code on my page. The problem is getting the…
-
1
votes1
answer497
viewsCommunication between MVC Controllers
I’m having trouble making a communication between Controllers each in a Area different, the public methods of the second controller are not available in the first. Is there any way to do this?…
-
1
votes1
answer102
viewsClick event does not work in custom control
I created a button (Usercontrol), until then ok, but when I put an event Click in it, does not work, already tried with the event Mousedown, also did not work. I don’t think this is it, but this…
-
1
votes1
answer106
viewsDoubt with angular and checkbox
I have a form with some inputs and some checkbox, when I do the search in the database is returned Json, and input fields are filled in but checkbox are not marked although I have declared the…
-
1
votes2
answers200
viewsHow to convert text into file to number with decimals?
I have this data written in the text file "000001010" (you only have this data), but I wanted when it was for the variable to be like this 10.10. I’m reading the file data like this: var linhas =…
-
1
votes2
answers397
viewsHow to convert a Dataset to Int32?
I’m having an information conversion problem that’s coming from my database to a variable of type Int32. When I do the select max(cur_id) from tbl_curriculo; I send the id information directly to a…
-
1
votes0
answers56
viewsHow to return the difference of a C# matrix without using LINQ?
I have a matrix A and B: Method: public static int[] RetornaDiferenca(int[] a, int[] b) {... } Calling the method: RetornaDiferença(new int[] {1, 2, 2}, new int[] {2}) The result would have to be:…
-
1
votes2
answers2522
viewsRegular expression for Telephones only with numbers and DDD C#
I would like a help to create a regular expression in C# that validates number of phones with DDD but no dots and dashes, only numbers. Would be in XX12345678 and XX 123456789 format.
-
1
votes1
answer80
viewsUsing C# 6.0 in VS2010
I have Visual Studio 2010 installed. I would like to know if it is possible to use the features of version 6.0 of C# in my IDE
-
1
votes1
answer673
viewsCreate popup with Rg.Plugins.Popup
Does anyone know any tutorial for creating popup on Xamarin.Forms using this plugin, Rg.Plugins.Popup? I need to create a popup and inside it a textbox or textarea with two buttons (Ok and Cancel).…
-
1
votes1
answer45
viewsUse variable in Parameters
I am trying to run the line below, but need to use variables. The line is as follows: CM.Parameters.Add("desnome", System.Data.SqlDbType.VarChar).Value = USU.xdes_nome; I need the following: desnome…
c#asked 7 years, 1 month ago Ednilson Teixeira 63 -
1
votes0
answers203
viewsNpgsql failed to call plpgsql function
I’m running some tests on the Npgsql. One of the tests tests the return of a plpgsql function. But the test is failing saying that the function does not exist. In the error description the name in…
-
1
votes1
answer788
viewsError Object Reference not set to an instance of an Object
I can’t find the error of this code when saving the webcam image, whenever I click save as and type the file name it returns me with this error using System; using System.Drawing; using…
c#asked 7 years, 1 month ago Felipe Deolindo 179 -
1
votes0
answers31
viewsError running Nancy on Linux (Ubuntu)
Hello I have an application (executable) that I am trying to run on a Linux VM in Azure, it works in the project, but when running with Mono (I have installed everything possible fsharp,…
-
1
votes0
answers26
viewsControl Dslr camera via web
People: I have a web application that I would like to be plugging in a dslr (professional camera) camera that would display the live image in a canvas in html or something, and that would literally…
-
1
votes3
answers82
viewsError formatting date in C#
I’m trying to format a date: string s = linha.data.ToString("yyyyMMdd"); but I’m getting an error in ToString() No Overload for Method 'Tostring' takes 1 argument Any hint? EDITED In my date field,…
c#asked 7 years, 1 month ago Italo Rodrigo 4,344 -
1
votes2
answers755
viewsVisual Studio 2017 no template
Installed VS2017 but not only 'Blank Solution' templates. I tried to uninstall and reinstall without success. Someone’s been through this before? Imagery:…
-
1
votes2
answers162
viewsRegex remove some elements from the style attribute
I need to keep just a few properties of the style attribute in tags present in a string of an html document, they will be placed in a Whitelist, everything else will be removed. In the example…
-
1
votes2
answers398
viewsWhat is the best way to authenticate in the database?
What is the best way to connect to the database using c#? Create a USUARIOS table, or create a USER in the database to access?
-
1
votes1
answer129
viewsSave uploaded data from a partialView
I have a PartialView with BeginCollection where I upload a list of products to Dropdowns dynamic: In this project I have a relationship ManyToMany between Product and Supplier where I have the…
-
1
votes2
answers1721
viewsHow do I know if the database connection was successful?
I need some help. I started programming in c# now and wanted to make a kind of status for my program. Something like "Connection to Database: Connected.". I made the connection and my program…
-
1
votes0
answers33
viewsCommunication socket in Windows service
Next, I have a problem with an application I am developing, I need to carry out a communication between a Windows service and a web application, the Windows service will stay in the local…
-
1
votes2
answers2646
viewsHow to take an ENUM constant for the entire value?
I have an Enum that represents the months: public enum Mes { Janeiro, Fevereiro, Marco, ... } How do I get the month description for the entire amount? E.g.: Enter with 12 and return December…
-
1
votes0
answers43
viewsProblem hosting Bot in Azure
I created a very simple bot using botframework and I am trying to host it in Azure, when I run it locally it works successfully but in the cloud is appearing the following error: I’m putting the…
-
1
votes0
answers126
viewsPost to a fan page using Webbrowser
I’m making an application to post on my fan pages, already log in, list the fan pages, it’s all right. I’m just not getting to put the text in the facebook text box. Look here: <div…
-
1
votes2
answers353
viewsEntity Framework search as case sensitive
People I am using Entity Framework 6, Mysql, ASP.NET MVC. The problem is this: when I do a search through the form (my search view) EF is case sensitive. When I do the query directly in Mysql, using…
-
1
votes1
answer60
viewsSearch result Nhibernate C#
I am making a query in Nhibernate, but I am not able to bring the desired result, I want to bring all my table items file that have no relation to another table called Layouts, I tried to use a…
-
1
votes0
answers19
viewsUnderstanding the MVC routes
I’m about to start a project in MVC 5 . NET but I don’t understand very well how it works this framework route. I’m used to ASP.NET 4.5 where I know that: The .aspx is the front-end. The .aspx.cs is…
-
1
votes0
answers120
viewsWindows Media Player
So I’m creating a media player in Visual Studio, and the only way I could find to get the video to go was through the Windows Media Player component. I also found that to remove the bars where the…
-
1
votes1
answer338
viewsFormat subitem listview
I have problems defining Subitem background color from listview when returning database query. I need that in the column n° 18, which will return values such as " Expired" and " In Day" when the…
-
1
votes1
answer33
viewsUnidentified tenum in html
I created the following helper: public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null) { List<SelectListItem> lstEnum =…
-
1
votes1
answer29
viewsHow to view through breakpoint what values have been passed to my method?
I wonder if it’s possible without using the Debug.WriteLine view the values passed to my method through Visual studio using a Breakpoint, whether by some external resource or not.…
-
1
votes3
answers333
viewsProblem saving accent with Entity Framework and Postgresql
I need to migrate a system with SQLSERVER database to a Postgresql 9.3. I’ve never worked with Postgre before so I’m using Entity Framework 6 with model-first to make the process easier. The…
-
1
votes0
answers322
viewsHow to create a dynamic div using database data
I have an administration page called (admin.aspx) with a table that has data that I will retrieve from my SQL Server database. My idea is on this page I select the data I need and by clicking a…
-
1
votes1
answer209
viewsPassing as parameter a generic type in an attribute in . NET MVC
In another question I asked here I had to modify my authentication class to return the values of the model referring to the user and the authenticated user type, for example, admins, users, clients,…
-
1
votes1
answer118
viewsHow to create a method that takes only one string and returns a generic type? . NET MVC
How could I create a method that doesn’t need to receive a type as a parameter, just a string, but would return a type? For example: public static T Guard(string guard_name) where T : class, IAuth {…
-
1
votes0
answers33
viewsFile . one of one note does not open in windows phone 8.1 C#
I have an app Windows Phone 8.1 that accesses Onedrive after authentication, I have access to all files/folders and subfolders of the logged in account. I’m having an error trying to open the one…
-
1
votes0
answers27
viewsDxerrorprovider Doubts in the use
How are you? I am starting to use Devexpress components, and would like to implement Dxerrorprovider, which in my case, if the value of the text box is null, or empty, would be displayed the error…
-
1
votes1
answer93
viewsOpen Access Report with Criterion
I’m a beginner in C# and I’m opening a report on Access, but this report has criteria, that is, it depends on a numbering to open. This numbering I have in a textbox and my doubt is how to pass the…
-
1
votes1
answer998
viewsSend Angularjs object to Webapi C#POST
I have a form, I am trying to save the information in the SQL Server database. <html ng-app="Crm"> <body ng-controller="CrmCtrl"> <form name="novoCrmForm"> <div class="row">…
-
1
votes1
answer576
viewsDelete files by extension
How can I delete files from a folder by extension? "Got" files with this code: string[] arquivos = Directory.GetFiles(st.path, "*.xml", SearchOption.AllDirectories); But I can’t delete…
-
1
votes1
answer85
viewsHow to use the list when you do not know the object that will be returned?
I have an Oracle database and need to popular a gridView. I’m doing with var, because I do not know the type that will be returned. It has to make a list in var, example list<var>, and then…