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
answer54
viewsNhibernate + . Netframework 3.5
Would anyone know which is the latest version of Nhibernate that works on . NET 3.5? I even searched the site itself, but could not find it. The one I own is 2.1.0.4000.
-
0
votes1
answer202
viewsWeb API - Blocking server-specific calls
Well I have the following doubt, after implementing the CORS in an application, I saw that there is still a security breach that is, if an application(Postman, Curl) make direct calls on the server…
-
0
votes1
answer64
viewsAlias directive - What would it be?
Good afternoon, everyone, I’ve been studying C#, I came to see about the Directive using, and in the C# documentation it says it has 3 uses, one of the 3 use items says it serves to create an…
-
0
votes1
answer43
viewsUWP Horizontal alignment of streaks in a Relativepanel
I’m creating a Hambugermenu similar to the Win10 Apps. The basis of Hambugermenu is SplitView and to distribute their children in the SplitView I chose to use a RelativePanel so I can choose which…
-
0
votes1
answer792
viewsSet Image to Button inside Listview Xamarin Forms
How to set another image for a Button that is inside a ListView by . Cs or in ViewModel ? I can’t access that Button no . Cs for being inside the ListView. In my Xaml, the button already has an…
-
0
votes1
answer40
viewsUse of Syntaxtree
I’m studying C# and came across the SyntaxTree while reading about Roslyn. I also read the documentation of Microsoft itself on the link: Introduction to syntax analysis However I still have two…
-
0
votes2
answers67
viewsSave an image by identifying it from Frameworkelement
I have this layout: <StackPanel> <Button x:Name="button" Content="Button" Click="button_Click" Height="50" /> <Image x:Name="image" Source="vermelho.jpg" /> </StackPanel> The…
-
0
votes1
answer210
viewsWebmethod to create Sales Document with editing parameters in the document lines
Good Morning, We are developing a webservice / method that creates sales documents. In the header I can pass all values to the header parameters. But on the lines how can I do the same? For example,…
c#asked 5 years, 11 months ago Bruno M. Lopes 21 -
0
votes0
answers30
viewsAsp button inside a modal does not Triggering to click Event
If I click the button, he’ll check the textbox , incorrect formats etc , but if the textbox are all validated it does not call the event associated with it any idea ? the boot is inside a form with…
-
0
votes1
answer294
viewsCreate thumbnail without stretching/shrinking the image in c#
I have this code that creates me thumbnails for my project: //**** INICIO GUARDA THUMB ********** // valores para altura e largura do thumb: int resizeToWidth = 260; //px int resizeToHeight = 260;…
-
0
votes2
answers1078
viewsDoubts about converting from Byte to Image in c# You are showing a strange and unusual error
I am trying to convert the bytes that are in a database to Image in a Picturebox in C# 2012, but when it arrives on a given line it says that the parameter is invalid, an abnormal error that never…
c#asked 7 years, 10 months ago Angolano de Ouro 11 -
0
votes1
answer385
viewsWebservice does not accept xml file
I am generating an XML, and sending to webservice, and it always returns me the same error, Error 500, however this error is vague, I managed to get the following error return: :Servercould not…
-
0
votes1
answer136
viewsBurger menu hiding when calling a new view Xamarin Forms
I have a View which is being called through a button of the MenuItem. But within those View contains another button that calls a new button View. This new View opens off the burger menu, ie it hides…
-
0
votes1
answer46
viewsScheduler for Azure
Does anyone know if I can make a simple console program that will do some SQL Insert and put it to run on the Azure scheduler? (whether it’s the free one or the paid one…
-
0
votes1
answer48
viewsI have a panel in aspx, but gives error in code Behind(Web Form)
I took a project in aspx to keep and got this on aspx page <asp:Panel ID="painelTeste" runat="server"> and in code Behind gives error The name painTeste does not exist in the current context.…
-
0
votes1
answer156
viewsC# Running a DDL command
I’m trying to run the Ddl command below that creates the table I need, but even not returning error the table is not created, would anyone have any idea where I’m going wrong? public const string…
-
0
votes1
answer106
viewsRead XML with equal tag (nodes)
I have this xml, and I need to get the tag <ns2:InfNfse Id="24030TZYKNKKIPZM4PU7XGAZJ0UA84O6"> But in xml there are several tags with equal names. I tried to do this way below: XmlElement…
-
0
votes1
answer78
viewsAsp net Identity
Good evening, it’s a simple question, I don’t even know if this is the right place to ask this (if not and can you tell me where I already thank you) but I want to learn how to use Asp.Net Identity…
-
0
votes1
answer59
viewsHow do I activate Timespan with a set time
I wanted to do a Timespan set, like this from 8:00 to 8:10 and after 16:00 to 16:10 he keeps sending a message that I created, outside of these times is not to appear. var startTimeSpan =…
-
0
votes3
answers3455
viewsConverting integer to string in C#
How do I convert an integer to a string? I have tried to search in places and did not find the answer, I have this problem just to finalize my project, if someone can collaborate, I would…
-
0
votes1
answer1275
viewsTransparent form with image C#
Next I’m making a tutorial screen for the program, I did not find a good solution to do. I created a screen over another with transparency, so far so good, but when I put an image on this screen, it…
-
0
votes1
answer1093
viewsName does not exist in the current context
I’m in the fight here on this project with asp.net, but the classes are right as I took a tutorial here on the net, they don’t give any error only when running the project ai shows. CS0103 error The…
-
0
votes2
answers414
viewsHow to reference an html button in C#
I have the following snippet of HTML code : This code belongs to a page of an Air OS radio (internet radio). I need to reference this button inside a program made in Windows Forms and do a function…
-
0
votes1
answer327
viewsProblems accessing a web api in a Xamarin Forms project
On my first screen of mine app mobile what I’m doing is the screen of Login, but whenever I try to log the return is Statuscode: 404, Reasonphrase: 'Not Found' I have confirmed and the uri is…
-
0
votes0
answers43
viewsString splitting
Being a string in the following format: string valores = "valor1#valor2#valor3"; I wish to store the values separated by # in a array, having such a result: teste[0] = valor1; teste[1] = valor2;…
-
0
votes1
answer44
viewsHtmlagilitypack - Does not format correctly
In my webservice I need to always format the HTML I receive. To make sure it gets properly formatted I use the Htmlagilitypack. HTML I receive: <p> <div> <b>text:</b> <img…
-
0
votes1
answer968
viewsReturn Batch Events Reinf - The structure of the XML file is in disagreement with the XSD schema
I am generating the R-1000 record for shipping test in the EFD-Reinf Restricted production environment and have already obtained assistance from the community in the following questions: EFD-Reinf…
-
0
votes0
answers180
viewsWeb alert in c#script
I am developing a web system on Asp.net and came across a problem. On the return of your Catchs, I return an error through an Alert to the user thus: try{ ... } catch(Exception ex){…
-
0
votes1
answer216
viewsHow to display, in treeview format, only the folders and subfolders, and the contents of both, that are on the desktop?
Good people, I’d like a little help I made a file explorer that aims to map all folders, subfolders and files of these folders and subfolders according to the letter that is selected. The problem is…
-
0
votes1
answer656
viewsIsession +Nhibernate (no Session or Session was closed)
In a Windowsforms project Using Repospository pattern, in a Generic class I have the following method: public IList<T> Listar() { using (ISession session =…
-
0
votes1
answer75
viewsCount the number of characters of a value within a column of a Datagridview [C#]
How to count the number of characters of a value within a column of a DataGridView? The goal is to add €0.02 for each letter in the column mensagem and then put the total in a Label.…
-
0
votes3
answers40
viewsI am producing a kind of form, but in age people put (age + "years")
I am producing a kind of form, but at age people put (age + "years"), but the variable is type int so it does not work, I wonder if there is any method of sending a message to the customer when he…
-
0
votes0
answers24
viewsError 500 when trying to Upload Video with Xmlhttprequest Asp.net/C#
I have an application that uploads video using XMLHttpRequest when I uploaded a small video (386Kb) the video goes up normal, but when I try a larger video (20Mb) it does not reach the function C#…
-
0
votes1
answer78
viewsHow to copy data from one gridview to the other?
how do I copy data from one grid to another added a blank line every two copied data lines? TAB_F_TABELAS_DAL d = new TAB_F_TABELAS_DAL(); var dados =…
-
0
votes2
answers94
viewsAccessible class across C#
I would like a class that is not static to be available for the entire application. At first I thought about turning this class into static, but for obscure reasons that are beside the point, I…
-
0
votes3
answers127
viewsHow to clear a list without losing all positions?
In my application in C#, I have a list List< float> where I store data arriving through serial port. With the execution of the application in progress this list begins to get huge. I am not…
-
0
votes1
answer39
viewsIs there a class in c#(WPF) equivalent to Qt’s Qsignalmapper?
When I was learning C++/Qt I used a very interesting class that allowed me to associate several interface buttons to a single event that, upon a value by which each button was mapped, allowed me to…
-
0
votes0
answers269
viewsSQL query for ASP.NET page with C#
On my client’s website, I have an SQL query that brings the result of the level of readiness of several collaborators. Only that, for now, I can only transfer to the page the result of the query in…
-
0
votes1
answer477
viewsHow to adjust the Form according to the size of the Picturebox?
How do I resize my form according to the size of the Picturebox component? In this case, the images in the Boxes may have different sizes. So I would like my Form to fit the size of the Picturebox.…
-
0
votes1
answer71
viewsWhat implementation would I use to initialize the data in the database using 1:N relationship?
My intention is to initialize a SubCategoria, but she needs a Categoria first (1:N). I wanted to know which implementation I would use to make this relationship work to boot into the database? I’m…
-
0
votes2
answers85
viewsRandomly generated numbers with arrays are repeated
I looked everywhere but I couldn’t find anything that would solve my problem. At the moment I have this: int[] nums5 = new int[100]; for (int i = 0; i < nums5.Length; ++i) { int aleat5; do {…
c#asked 5 years, 9 months ago D. Rodrigues 79 -
0
votes0
answers308
viewsWhat better way to work/store files in Base64 C# + Sqlserver
I am consuming an external API, and in return I have a PDF file in format base64, would like to know how best to work/store this kind of data in the database SqlServer + C#. My question is: 1 - I…
-
0
votes0
answers89
viewsAsynchronous Action Error (Async)
This action should send an Asynchronous email, all very simple so far, including using the same class in other projects with the same version of MVC. But to my surprise, this project does not run.…
-
0
votes1
answer139
viewsError when obtaining value of a property through reflection
I’m having trouble with the following line of code: var key = entity.GetType().GetProperties().FirstOrDefault(p => p.Name.ToLower().Contains("id")).GetValue(this, null); Every time he gets on…
-
0
votes0
answers86
viewsC# Choose Email Box when sending
I was wondering if there is any way to send emails to other inboxes, for example gmail At the moment my code for sending emails is this: using (var smtpClient = new…
-
0
votes1
answer75
views(C#) Does the Code Not Save the information in the array (table)?
I have the code below. Its purpose is to check if it already exists in the table SalaReservada an appointment on the same day/time/room. If any, I check the next room I brought codSala, and if it…
c#asked 5 years, 9 months ago Rebeca Nonato 1,163 -
0
votes1
answer27
viewsReflection c# WPF Observablecollection
I have a problem, when creating an Observablecollection I do so: ObservableCollection<MinhaClasse> Lista = new ObservableCollection<MinhaClasse>(); So far so good. My problem is, through…
-
0
votes0
answers63
viewsHelp in Binding C#
I have this following code: private void DataGrid_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var i = 0; var d = DataContext as TicketExplorerViewModel; if (d == null)…
-
0
votes2
answers3407
viewsError: 'Executereader: Connection property has not been initialized. '
I need to make an access to a database where I put the data myself, the insertion part is working, but now I need to "take" the data again when I click on the button, only it does not matter the way…
-
0
votes1
answer36
viewsHiddenfield in aspx to cshtml
I have a doubt about hiddenfield in aspx we use the following command: <asp:HiddenField ID="HiddenField1" runat="server" /> And for cshtml it is possible?…