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
answer124
viewsRecover Parameter Filled in Actionresult
I have a problem that I’ve tried many ways to solve and nothing. When loading the page the page is populated in a table a list, but when it is submitted the template is null, but if you consult the…
-
0
votes1
answer82
viewsHow to check if the line was broken?
I use File.ReadAllText to read the text inside a file .txt. private void label9_TextChanged(object sender, EventArgs e) { string text = File.ReadAllText($@"{pathname}", Encoding.UTF8); if…
-
0
votes1
answer213
viewsHow to create a WCF (.NET) POST type method that receives a String parameter from the URL and Stream via POST?
I tried to use in my service but I can’t get anything other than this error. Error: ExceptionDetail, provavelmente criado por IncludeExceptionDetailInFaults=true, cujo valor é:…
-
0
votes1
answer226
viewsReading txt with Streamreader
When reading a TXT file, of accounting releases exporting by a third party system, being my problem in the lines that have the Nº. VLR REF SOMETHING NO 1834 MORE TEXT Using the class StreamReader as…
c#asked 6 years, 11 months ago Pablo Tondolo de Vargas 5,444 -
0
votes2
answers52
viewsSQL/LINQ vs. Data to feed
I’m trying to generate a query in VS2015 with Linq (here, I exemplified in SQL, to speed up my tests right in the database) that returns the data grouped and counted from 6 months ago, it happens…
-
0
votes0
answers23
viewsMy chat with signalR is not working, I’ve followed several tutorials and does not work
File [ Chathub ] using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; namespace Sandes { public class ChatHub : Hub { public void…
-
0
votes1
answer145
viewsEntity Framework. Select only 1 from a list in Include?
I’m only trying to get a 1 record of the Phones and Emails lists. var lista = Db.Oportunidades .Include(x => x.Conta.Proprietario) .Include(x => x.Conta.Contatos.Select(c => c.Telefones))…
-
0
votes1
answer54
viewsMaintaining Complextype creation pattern in EF Core
In the past I used Entity Framework 6.0, and when creating a class as in the example below: public class Produto { public int ProdutoId { get; set; } public string NomeProduto { get; set; } public…
-
0
votes2
answers438
viewsApi with Item Array does not receive the posted data
I have an Api that receives the posted data as it shows the image, it turns out the data is coming empty, I appreciate the help.…
-
0
votes0
answers760
viewsASP.NET MVC: Problem when assigning decimal value
Fichaviewmodel.Cs [Required(ErrorMessage = "A altura é obrigatória.")] public decimal Altura { get; set; } fiche.js $("#Altura").mask("9.99"); Fichacontroller.Cs [HttpPost] public ActionResult…
-
0
votes0
answers47
viewsOpensource alternatives to Postsharp
Someone knows a good alternative Opensource at the Postsharp? I know it has the Free version, but I am developing some Nuget packages using attributes and I find the dependency of Postsharp heavy…
-
0
votes1
answer1560
viewsRuntime error - 1035 - Selection Test 1 - URI Online Judge
First of all, I don’t have much experience with C#, I just know programming logic. I’m studying C# out of curiosity, it’s a language that always interested me. I am studying for URI and I am not…
c#asked 6 years, 11 months ago Julio Cesar 135 -
0
votes1
answer25
viewsCondition on a list
I have a program that inserts information into a CSV file. And I wanted to check if there is data in the variable if it does not show a message that there is no data entered in the file. var csv =…
-
0
votes0
answers24
viewsParameter passed by value being modified as reference
I have the following situation, I have an object with value 2800, when I pass this object by value and divide the value of an object attribute within the scope of the function, the value of my…
c#asked 6 years, 11 months ago Leonardo Bonetti 5,313 -
0
votes1
answer61
viewsIt is bringing the whole column and not only a specific id
I’m trying to catch the last mile registered on the seat of a specific vehicle, but it brings me all the miles and not a specific vehicle. My Controller: var Rota =…
-
0
votes1
answer281
viewsError using System.Windows.Forms.SendKeys.Send("%{DOWN}")
In a windows form application I have a Datetimepicker and I do not want it to display the date so I did the following: public CadNovoPagamento() { InitializeComponent(); dtpEmissao.Value =…
-
0
votes2
answers33
viewsWhy can’t I call cta1 instantiated object in btnCriarConta_Click?
Why can’t I call object cta1 instantiated in btnCriarConta_Click? namespace proj3 { public partial class conta : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { }…
c#asked 6 years, 11 months ago Lucas Navarro 15 -
0
votes1
answer103
viewsApi gets date with changed month and day if parameter is sent by url
I have an api that gets a date (the date is sent as string and received as Datetime): [HttpPost("ObterDados")] public JsonResult ObterDados(DateTime data) { //codigo if I post with the parameter in…
-
0
votes0
answers143
viewsHow to update textbox from another WPF window
I have 2 windows wpf (C#) To register B search engine provider Inside the window A to a textbox and a button that opens the window B, Inside the window B has a textbox and a button. How do I move to…
-
0
votes1
answer53
viewsRealm . NET - Create object copy
Guys I’m having trouble using Realm, in . NET with Xamarin. I can usually add, update or delete objects from a Realm. But like the pro version . NET does not have a copyFromRealm, here comes my…
-
0
votes2
answers3518
viewshttps communication error with Webservice
I have a problem communicating with webservice of eSocial, my certificate is correct, however, still can not establish a secure connection, displays the following message: Error making HTTP request…
-
0
votes1
answer1462
viewsAutomatic line breaking textbox multiline email form C#
Hello guys help me here because I’ve tried everything and it didn’t work, I’m not able to do the multiline textbox send the break line by email in the contact form. ex: Ola Quebra de linha tudo bem…
-
0
votes1
answer162
viewsHow to use Drawtobitmap in WPF to take screen print?
Follows functional code of the WinForms: Bitmap pic = new Bitmap(label1.Width, label1.Height); Rectangle rect = new Rectangle(0, 0, label1.Width, label1.Height); rect = label1.ClientRectangle;…
-
0
votes0
answers797
viewsImage Capture via Webcam C#
I have an application developed with Windows Form in C# that captures image through webcam installed on the computer. This application has several photons, and one of them is the image capture. When…
-
0
votes0
answers348
viewsVisual Studio 2017 Design XAML bug, does not recognize Resources
internal static System.Drawing.Bitmap radio_hover_btn { get { object obj = ResourceManager.GetObject("radio_hover_btn", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } I’m having…
-
0
votes0
answers63
viewsSearch engine behaves equally using multi-thread or single thread
Good afternoon, I’m developing a routine for doing PDF file research. My idea is to distribute the search processing in each file in different threads to optimize the response time. The…
-
0
votes0
answers50
viewsWrong binding in <select> ASP.NET MVC <option>
When I give a post in the form for the Controller, the Binding in asp-for="VehiclePlate" picks up the value of option of select (@vehicle.Category). However, I want to catch the text of option of…
-
0
votes0
answers90
viewsInvalid/Unknown/Unsupported format error
I have the following line of code: new PrintPDF(ConfigurationManager.AppSettings["Comprovante"]); Which I declare in app config.: <add key="Comprovante" value="C:\Client\Resp\Comprovante.txt"…
c#asked 6 years, 11 months ago Igor Carreiro 1,917 -
0
votes1
answer46
viewsLoad the photos of a specific directory in a texture string c#
I am making a new application and need to upload photo from a specific directory on the computer in this case c:\\Biosearchassets for a Gui Texture in unity3d I was able to find an example but it…
-
0
votes1
answer63
viewsCreate a class reference from a variable
I don’t know if I explained it correctly in the title and I ask you to correct me. I am making a simple system of a C# bank by object orientation following the booklet of kaolin (Link to the…
c#asked 6 years, 11 months ago Luiz Nascimento 81 -
0
votes2
answers343
viewsGmail notifies that email is usually used to steal information when I use content-type ="text/html; charset=utf-8"
I use the Gmail API to send email’s marketing, and always respect anti-spam limits and standards. And yesterday I started sending mass emails, on average 2,000 a day, but after a while I realized…
-
0
votes1
answer72
viewsHow to create a dialog tree with a custom language in C#
I created a dialogue creation language for a game, but at the stage where I analyze recursion, it is always generated incorrectly. The syntax looks like this:…
-
0
votes2
answers111
viewsIncrease file upload limit by App.Config C#?
I’m having a problem, we used a file sending system that was done in Webapplication and we will implement it also in a dll. In Webapplication it is possible to configure in Web.config the maximum…
-
0
votes1
answer1240
viewsIIS - Capture user logged in to the machine without using Windows authentication
I have a website that uses the user logged into the computer to validate what functionality he will have access to within the site. To capture the user logged into the machine I am using the code…
-
0
votes1
answer13
viewserror loading Progressring (Mahapps)
I have a Progressring on a Page in WPF that needs to be displayed while the Grid is being loaded (Goal: Show the user that you are loading) and then be disabled when loading it has been completed.…
-
0
votes1
answer439
viewshow to refer by name or half of the name in the birthday management list c# console application?
So I’m creating a birthday management file, where I can add and query people, but I’m having a hard time making a code to query person by name, but doing with what appears to the person and choose…
c#asked 6 years, 11 months ago Roger Silva 23 -
0
votes1
answer404
viewsC# - If in Combobox Exercise Caelum
Good afternoon guys, I’m already a few hours trying to solve this C# workbook exercise of Caelum, but I believe I am far from solved. I would like to know how to use an IF within a Combobox to make…
-
0
votes0
answers654
viewsC# Failed to send emails using Smtpclient
I am getting the following error while running the system on the server with port 587: Mailbox not available Error stack: When I change the door to 465 and Smtpserver.Enablessl = true; timeout…
-
0
votes1
answer27
viewsSave the form so that when returning an error it does not erase the inputs
I’m making a registration system, when the data is correct he saves in the bank in a good, when it gives error it returns where it is wrong but it erases everything that has been filled or is not…
-
0
votes1
answer364
viewsProblems with Findsystemtimezonebyid in Web.API . NET Core in Docker (Linux)
Setting: I am migrating a Webapi to . NET Core, on Windows is running normally. Problem When I am running on Docker (Linux) (Docker-Compose) I am having the following problem: "The time zone ID 'W.…
-
0
votes1
answer100
viewsReceiving json from a web server
I am working with firebase, and I am searching the server data with Httpwebrequest, I was able to recover this data in the following way; {"-L1od7ljenm8zhsps7ne":{"Age":"18…
-
0
votes1
answer271
viewsRedirection with parameters
I have the following method: public ActionResult exemplo() Returning: int act = (int)TasksTypeEnum.CARGA; return RedirectToAction("Index", new { q = study.Id, msg = 1, action = act }); The page…
-
0
votes1
answer70
viewsUWP application run sequence of videos in Mediaelement coming from a List<string>
I’m using the Media Element in an application UWP to run a sequence of videos, as I do for when one video ends the other runs in sequence? In the code below when the first video of…
-
0
votes1
answer43
viewsProperties Linklabel Windownsforms
You can use the property LinkLabel to open a kind of Modal to view history of a particular item that are stored in table ? Example: And in that Form would bring that info that is stocked from the…
-
0
votes1
answer517
viewsPass data to viewbag from controller to view using Chart.JS
I am trying to pass the data from a list to a viewbag, but it is not returning correctly in the view. My model and control: public class DataPoint { public String nome = null; public double y = 0;…
-
0
votes1
answer254
viewsImages disappearing from my application using Xamarin Forms
I made an application using Xamarin Forms Cross Platform, at first I only need the android version of it so I don’t care about IOS and Windows. The app is working properly when I test it on one of…
-
0
votes0
answers175
viewsReturn Image (Blob from Database)
I am unable to return the images of a controller. Below I explain all the encoding: I created a controller, and a view for this controller that returns the image that is in an Oracle blob field. It…
-
0
votes1
answer478
views"Filter" options from a Dropdownlist based on a selected option from another Dropdownlist
Greetings friends of Stack Overflow! I’m having a cruel doubt in Javascript/Jquery that is consuming me more time than I would like (heh!) - I would like to filter one Dropdownlist based on the…
-
0
votes0
answers380
viewsThere has been a violation of the referential integrity restriction
I am getting this error every time I try to update an object in my SQL database via Entityframework, the error is as follows: A reference integrity constraint violation occurred: Property values…
-
0
votes1
answer1693
viewsGroup and add to a query in SQL Server
Good afternoon, I have the following problem: I’m developing a C# program for internal company data query. It is working perfectly, but I need to group field(s) and add another(s) that contains…