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
votes0
answers151
viewsASP.MVC ENTITY Code First (odd problem)
I do not know if I am doing something wrong (probably yes). But EF is persisting the data in a BD and in a table that it creates alone. I’ve repeated this step-by-step twice and the result is the…
-
0
votes1
answer292
viewsCalculate circular Progressbar time C# (Windows Forms)
I have the following circular Progressbar, the idea is that it be decremented second by second, so far so good. However, I need the bar to always start complete (circling the circle 100%) and the…
-
0
votes1
answer40
viewsOpen.CV Error Save File
Good morning guys, I have the following code: var faceImage = new Image<Gray, byte>(new Bitmap(bm)); imagensFace[i] = faceImage.Resize(100, 100, Inter.Cubic); faceLabels[i] = todasFaces[i].ID;…
-
0
votes1
answer1350
viewsChange Sprite image when Unity is clicked
I need that when a button is clicked, if the answer is correct the image (a bush) change (to a cow in front of the bush). public class mudaSprite : MonoBehaviour { public InputField dgt; public Text…
-
0
votes1
answer3475
viewsC# - How to make a simple Web Scraping
I want to read information from an HTML page of a online radio. I have tried to read using Htmlagilitypack, but without success because the page in question I am working does not use Elementid, I…
-
0
votes1
answer230
viewsC# Join 3 tables using Linq?
I’m picking it up to learn C# and I’m picking it up at some points. I have 3 tables. Follow the models public class Tag { [Key] public int ID_Tag { get; set; } [Required(ErrorMessage = "Preencha o…
-
0
votes0
answers108
viewsSending Email is leaving the attachment path in the body of the email
I’d like some help! I made a class to send emails in my application, where reports will be generated to be sent in PDF and XML format, but the email is being sent with the path of the files in the…
-
0
votes1
answer32
viewsError in passing C#parameters
I’m making the following mistake: Error 1 Cannot implicitly convert type 'System.DateTime' to 'string' In the following code: t.Codigo = GetValorDateTime(tabela, i, "DataDeContrato",…
c#asked 6 years, 10 months ago user75204 -
0
votes1
answer117
viewsHow to load Textboxfor after onchange of a Dropdownlistfor?
How can I load a Textboxfor after choosing a Dropdownlistfor element? I load the Dropdownlistfor with a list and from that list I want to filter an object to load the balance according to the…
-
0
votes0
answers477
viewsHow to get User’s location - City State
I wonder how do I get user location so that I can make my systems automatically select the city of Dropdownlist City. Through a blog the author teaches how to make this development that I even tried…
-
0
votes1
answer40
viewsReal type fields in bank with problems loading Model
About 3 or 4 months ago I had this same problem, which after I remade all my Model, solved it. And now it’s back to the same problem. Before it was with the float and now with the guy Royal. In my…
-
0
votes1
answer319
viewsHow to make a query bringing me the last value of a specific id
I’m trying to do a c# query with Mysql, where there are two tables: Compra --> Table where you take the IdProduto and the Product Value. Abastecimento --> Table where the IdProduto and the…
-
0
votes0
answers84
viewsSend information to Rest and trigger notification
I’m in doubt in the construction of a REST, not well in construction, but which way to go, what approach. See my business. 1) The customer asks for a discount. 2) As the seller is not allowed to…
-
0
votes0
answers193
viewsError placing conditional build on Assemblyinfo.Cs file
When I put this in my Assenblyinfo.Cs do not compile #if DEBUG [assembly: Application(Debuggable=true)] #else [assembly: Application(Debuggable=false)] #endif and gives error in almost all classes.…
-
0
votes0
answers308
viewsHow to activate Viewer Ports
I have an application that uses rdl files, when opening in visual studio 2015 an error, and it appears as incompatible, however I have already installed the data tools, and the report Viewer , how…
-
0
votes1
answer117
viewsAdding lines from an array to a Window Form list view
I am doing a project to solve the binomial of Newton, this part is easy I managed to solve the problem on the console the way I wanted, now I am migrating to Windows Form and I have a problem to…
-
0
votes1
answer380
viewsHow do I hide or clear the url when I get Asp.net mvc?
I wanted to know how to clean or hide data that I pass through a URL to a webapi so that the data n become apparent and do not disturb my routes.. following example:…
-
0
votes1
answer881
viewsHow to assign the value of a Tempdata["Test"] or Viewbag.Id to an html input?
I wanted to know how to take the value of my variable tempData and put in an html input, in value maybe... someone could help me? Code below: <div class="container-fluid"> <form…
-
0
votes1
answer88
viewsEntity Framework 6: Context Management Problem
I have the object Agenda and create it as follows: public class Program { public static void Main(string[] args) { var clienteDAO = new ClienteDAO(); var treinoDAO = new TreinoDAO(); var agendaDAO =…
-
0
votes1
answer540
viewsLosing Session after Request
Good guys, I have a problem that so far could not solve. It only starts to occur after a ajax request, in which I submit a document and return to url in a json, to be caught in the javascript, be…
-
0
votes3
answers437
viewsVisual Studio INSERT command error
I have a web application in visual studio where I am getting the following message whenever I try to give an Insert command System.Data.Sqlclient.Sqlexception: 'An Explicit value for the Identity…
-
0
votes2
answers1379
viewsSelect line from a gridview and pass the values to a textbox
I am facing problems trying to find a solution so that when I click a grid view, it passes the values contained in the line to text boxes. My gridview is being populated, but I need to find a…
-
0
votes0
answers36
viewsWhy is the Activated event triggered more than once?
I need an event, which is triggered every time the user clicks Form, tried to use the event Activated but the event is shot 8 times for the same click. I’d like to understand why it’s shot so many…
-
0
votes2
answers115
viewsSending email C# Error Invalid HELO name
My doubt is the following, in the system I develop has option to send email direct from the system, for example Nfe email and files. I use the following setting to send the email. MailMessage…
c#asked 6 years, 10 months ago Diego Silva 1 -
0
votes1
answer43
viewsRuns splitting over and over
Good guys, I’m having a problem that is disturbing me a little, I’ve searched about and found nothing to help me. I’m researching certain variables in one Word Template to be able to perform a…
-
0
votes1
answer90
viewscompare datatable with gridview
my question is this: i have a gridview that I populate it with a data table of a table called "Discountdoclient", but I need a button that when it is clicked it goes in another table called…
-
0
votes1
answer79
viewsPreventing sending data when updating page F5 in ASP.NET
I’m having a problem, I have a grindview with products, every time I add a product in the stamp it add, but if I click on F5 it adds the dice novamento in the cart. public partial class carrinho :…
-
0
votes0
answers56
viewsFailed to open file after application installation in C# WPF
I’m creating a C# installer using visual studio 2017 installer project in this project there is a user manual it is contained in the root of the project, when I run it either in Debug or Release…
-
0
votes1
answer839
viewsEdit value within an XML node with C#
I have a login system in C# and a following XML file: <?xml version="1.0"?> <Usuarios> <Usuario> <User_ID>001</User_ID> <Password>010309</Password>…
-
0
votes1
answer211
viewsHelp to write to USERS and Aspnetusers at once
Help please. I’ve spent my whole day redoing various parts of the system, trying a lot of different solutions but ended up without ideas. I have a solution with several applications. One of these…
-
0
votes2
answers94
viewsConfiguring Angulasjs Routes with ASP.NET MVC
I’m having trouble routing Angularjs with Asp.net mvc. I set up my routing in the app.js and when I click on my links the pages are not being redirected correctly, the only page that appears…
-
0
votes0
answers322
viewsError: The Entity types 'Customrole' and 'Aspnetroles' cannot share table 'Aspnetroles'
People created the whole structure Identity to work with INT instead of GUID. Using Database First and included in the database, with a create script, the modified Identity tables (I only changed…
-
0
votes0
answers95
viewsError saving data with EF
I am assembling my unit tests and trying to save the data in a table using the Entity Framework, but at the time I run it returns an error. Validation failed for one or more entities. See…
-
0
votes1
answer106
viewsUnity C#Object Selection
Well, I’ll get to the point, could give me a force in this script I’m doing, it selects using buttons -1 and 1, until it works more the previous gets bugged using System.Collections; using…
-
0
votes0
answers60
viewsGenerate a new control for each listed item
Hello, based on the code below, I would like to know how to generate a new control( in my case a grid) for each existing item in my Listbox... My Listbox: <ListBox Height="380.585"…
-
0
votes1
answer298
viewsHow Popular Image in Gridview?
I’m doing an app on Asp.NET, with Entity Framework and using the database Oracle and here’s the thing I’m uploading the image by a button and saving in the database with the type BLOB until then all…
-
0
votes0
answers184
viewsMonth and day reversed when saving to database
I’m using datepicker of jqueryUI to choose the date in a calendar, the problem is, if I choose 04/12/2017 is saved at the bank 12/04/2017. datepicker: $('#schedulingCalendar').datepicker({…
-
0
votes0
answers231
viewsApplication to download all files from a remote FTP directory
I’m trying to make an installer-like application for a proprietary system. The process it does is: creates a directory and two subdirectories on a PC that will use the system. After creating the…
-
0
votes0
answers540
viewsHow to read the xsd file from within my C#project
I’m validating an xml from an xsd file this way: XmlSchemaSet schemaSet = new XmlSchemaSet(); schemaSet.Add("urn:bookstore-schema", @"D:\Arquivo\VoltVarPlanning.xsd");…
-
0
votes0
answers1257
viewsSave File in Physical Path
I am uploading an image I receive via form using C# ASP.NET. My code is working like this: [HttpPost] public ActionResult UploadFile(HttpPostedFileBase file) { try { if (file.ContentLength > 0) {…
-
0
votes1
answer464
viewsDatagridview loads the data but does not display it
I have a Datagridview, it loads the data but does not display them. private void AtualizarGrid() { //Procura no banco os registro digitado na caixa de pesquisa. AlunoDAL alunoDAL = new AlunoDAL();…
-
0
votes0
answers127
viewsSend used file @Ajax.Beginform and Xmlhttprequest
I have the following doubt: I’m doing a post with @Ajax.BeginForm, but the same does not send file, so I wanted to use the File Api, my idea was this I would do the post for @Ajax.BeginForm thus:…
-
0
votes2
answers236
viewsC# doubt with html
I have an application that carries an image that is inside the project. When I pass the directory manually (eg.: src="~/Imagens/logoACESSO.png") it loads the image normally, but when I pick the same…
-
0
votes0
answers33
viewsError while updating page
I am having an error that when updating the page her gridview runs the Rowcommand button clicked and adds again a product to the cart I created, I wonder if there is a way to block this without…
-
0
votes0
answers131
viewsIs there a way to use CSHTML (Razor) in ASPX Webform projects?
I was taking a look in that question in Stackoverflow English, because I really find it very confusing to use ASPX files and find the syntax of Razor more user friendly. When trying to add a file…
-
0
votes0
answers539
viewsOpen VS Code Projects for VS 2017
I own the layered architecture that was created in Visual Studio Code : When opening in Visual Studio 2017 besides it does not open all files : When running the project by selecting the Web.Api…
c# visual-studio software-architecture visual-studio-2017asked 6 years, 10 months ago Bruno Jesus Santos 11 -
0
votes1
answer172
viewsTaking a string from an XML I received from an http request
So guys, the problem at hand now is that I have to pick up two lines that are in an XML, I get this XML through an httpRequest, and then apparently starts the problem. What I’ve tried so far is: ...…
-
0
votes1
answer162
viewsHow to dynamically align the margin of a label via windowns form code?
I have the lblStatus which serves to assign 4 different values according to the query and each value has a different size, so there is no way I can directly form by the property the position. Then I…
c#asked 6 years, 10 months ago Igor Carreiro 1,917 -
0
votes1
answer113
viewsDownload pdf not working - Angularjs, C#
I need to return a pdf and download in the makeup of it. However when returning the pdf Blob does not recognize it $http.post($rootScope.raiz_ws + "/pdf/PdfCompraVenda", listProdutos) .then(function…
-
0
votes1
answer967
viewsSystem.Argumentexception: 'Invalid parameter. '
I created a button with button24_Click_1 to take printscreen from Form1: private void button24_Click_1(object sender, EventArgs e) { var frm = new Form1(); using (var bmp = new Bitmap(frm.Width,…