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
answer116
viewsHow to make this email form in C#?
I am starting now to work with the MVC standard Asp.net, I created a view for contacts and insert a form in it that when filled and clicked on the send button will go to my email, so I only did the…
-
0
votes1
answer832
viewsError: Undefined object reference for an object instance
I’m trying to rescue data from a screen with a Id specific, to later record on another screen, but an error occurs saying: "Undefined object reference for an object instance." [HttpGet] public…
c#asked 6 years, 10 months ago MAXF Xavier 11 -
0
votes1
answer137
viewsCannot serialize Member * because it is an interface
Staff bumped into above error while trying to create a webservice and I’m having a hard time interpreting and treating him. Detailing what I did: Within a project InpartSaude.WebApi.Api in one of my…
-
0
votes0
answers85
viewsUnhandled Exception: System.Typeinitializationexception
MySqlConnection sqlconn; string connsqlstring = "server=localhost;user id=sql10217362;persistsecurityinfo=True;database=sql10217362 --debug"; sqlconn = new MySqlConnection(connsqlstring);…
-
0
votes3
answers161
viewsManipulation of Textbox
You simply fill in the fields Modelo, Placa, Km and it will be saved in the fields multiline down below: But when I click on the "Save" button the result is totally opposite to the expected one. I…
-
0
votes1
answer321
viewsMy _Layout.cshtml file is not being recognized in the application, what to do?
I’m making an application in MVC Asp.net, and suddenly my application no longer recognizes the layout file being no longer applying the bootstrap and jquery... How can I fix it?? My layout file is…
-
0
votes0
answers61
viewsCreating a Method to make the character go up to Coord Mouse Course
Good morning guys, I’m wanting to create a method to make the character walk up to the mouse coordinates, this method will be done on the server, so I made him receive the mouse coordinates, only…
-
0
votes1
answer506
viewsWebservice REST with authentication [ID, CPF, User, Password]
Hello, I’ve been searching the web for a while but I can’t find clear answers.. I want to implement a webservice Rest, with tokens and etc for security, and the webservice consists of only GET for…
-
0
votes0
answers76
viewsWrite an XML file inside Solucion C#
Good evening Everyone, I would like a help, the structure of my project is according to the image below. I would like to import data from my table to this 'Arq.xml' file that is inside the project.…
-
0
votes0
answers510
viewsConsume API Rest in C# by Ajax in jquery
Hello I have a C# API that Returns a JSON object Follows the code [HttpGet] public string Login(string Pass, string User) { Return ret = new Return(); try { UsuarioDAL DAL = new UsuarioDAL(); var…
-
0
votes2
answers63
viewsHow to center 02 Textview of Videoview
I have 02 Textview and I want to put them in the center of a Videoview where a text is on top of each other. <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
-
0
votes1
answer316
viewsError handling in C#!
Guys, the following is, in my application I would like to see a page with the error occurred, but that this page has all the formatting proposed in the layout, so this is not happening, because it…
-
0
votes1
answer447
viewsProblems with Backspace in Textbox
I have a project to build a textbox that would only include hours and minutes (With Datetimerpicker, da para fazer tranquilo, however need to click in another field to change data, and I found this…
-
0
votes2
answers72
viewsThread and task with static method
How do I return the result of this method to a textbox static async Task<object> StreamingRecognizeAsync(string filePath) { var speech = SpeechClient.Create(); var streamingCall =…
-
0
votes1
answer678
viewsProblems referencing Javascript and css files - Asp.net Core
I’m trying to adapt a layout model that I found on the net, in my Asp.net core, but I’m not being able to make it work.... I created a Content folder at the root of the project and within it I have…
-
0
votes1
answer128
viewsFilter Json from the bank using Lambda C#
I’m starting development and I’m in need of some help. I got this Json I’m getting from the bank. But I need to filter the information by name for my return method. E.g. If the name = "Percent…
-
0
votes1
answer53
viewsBecause when I’m treating an error it doesn’t load the _Layout file?
I am doing an error handling using Json Result, when displaying the error message I should display the page formed as it rules in the _Layout file, so the page is loading all blank, does anyone know…
-
0
votes1
answer32
viewsProblem when changing backgronud color of expressions of a richTextBox
I made a code to change the backcolor of all richTextBox expressions starting with a @. It’s all ok, however, there is an error that I’m not able to solve. If the first thing I write is @expression…
-
0
votes1
answer174
viewsGet Textbox value inside the Repeater with Javascript Event Onchange
Good afternoon, I’m not getting past the value of a TextBox asp.net created within a Repeater as a parameter for a function javascript event onchange. I need to pass two parameters the first is one…
-
0
votes0
answers149
viewsHow to change the resolution of a c#webcam?
I would like to know how to change the resolution of the device, the webcam saves up to 15mpx but I can’t change the resolution of it in my program, it keeps saving the images in size 640x480. (I’ve…
-
0
votes1
answer128
viewsHow to call a C# service using Angularjs
Good afternoon, so I’m doubting how to call a service in C#, I’ve tried several ways but failed. (function () { 'use strict'; function Service($http, $q) { const url =…
-
0
votes0
answers85
viewsArray Animation C# Unity
Error in the array of Animation, please see in the video that you will understand, at the time of the change of an object to another it is totally erased. Video public Animation[] Animation1;…
-
0
votes1
answer2058
viewsHow do I place an image in Itextsharp?
I’m trying to put an image in the pdf, but it’s an error because Itextsharp’s Image class only accepts Uri, and what I have is an incoming stream that I’ve already converted to System.Drawing.Image.…
-
0
votes1
answer359
viewsRead html file and get the value of a selected select
I am reading an html file and need to get the value of value of select user selected, how to do ? HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); var select =…
-
0
votes1
answer254
viewsInsert using parameters in the C# application for the Oracle database error: ORA-01036: invalid variable name/number
I noticed that there are many questions about this error but none solved my case the connection works normally, there is the Insert method(): public bool Insert(ArrayList arrAlunos) { vsql = "insert…
-
0
votes2
answers53
viewsAttach dropdowlist item and a li Asp.net mvc
I have a view with dropDowlist that contains data that comes from the database and just below put a buttom that when I click will attach the selected dropdownlist item in a list, I made a code here…
-
0
votes2
answers161
viewsHow to manage threads in C#?
I’m developing a project and I think I’m going to need multithreading. While starting a thread new doesn’t seem difficult, I can’t understand if I have to finish the thread or she ends up alone. My…
-
0
votes0
answers53
viewsEF - A Member of the type, 'X', does not have a corresponding column in the data Reader with the same name
Good, I am using Entityframework to pass the result of this query: SELECT a.* FROM [Logística$Sales Invoice Header] AS a INNER JOIN [Logística$Sales Invoice Line] AS b ON a.No_ = b.[Document No_]…
-
0
votes1
answer372
viewsClass to write/read formatted TXT files
I’m using the Classe Textwriter to read/write a card receipt on .txt however it does not have the property of formatting letter size, spacing, etc. This makes the proof printed on the thermal…
-
0
votes1
answer30
viewsinput is not pulling right bank value
I need some help. On my system, I have an input that brings back a date from the database. As you can see in the photo above the date informed is 06/09/2017 00:00, only that the actual date of this…
-
0
votes2
answers436
viewsBootstrap message, apply Location.Reload upon termination message
Good afternoon, I’m trying to apply location.reload at the end of a messagebox after effect .remove() 2 seconds but I’m not familiar with the javascript someone could help me with the code: function…
-
0
votes2
answers45
viewsProblem in Query SQL
I am developing a C# application and I use a BD in Mysql. In a part of the system, I need to increase the stock of a certain product, test the command in Workbench and worked well, but when I run…
-
0
votes1
answer950
viewsForeign key Entity framework Asp.net mvc
I have My Repair and Repair Table and I’m getting the following msg when I try to update my Migration: "The introduction of the FOREIGN KEY restriction 'Fk_dbo.Fixeddbo.Pecas_pecasid' in the 'Fix…
-
0
votes2
answers131
viewsUpdate OLEDB Not working
Good afternoon, I am trying to update an excel spreadsheet but the command is not changing any value, it is only corrupting the spreadsheet. I create the last two columns and rewrite the rest…
-
0
votes2
answers1270
viewsPOST method receiving object vázio. C#
I have a controller with a POST method that always receives the null parameter. I’m sending JSON through Portman. I have tried to put the class as parameter, I have tried for string as parameter and…
-
0
votes0
answers398
viewsFileupload Jquery with C#
I have the following problem I am using MVC (C#) and I need to upload documents in general(. doc, . pdf , . png, etc) I am using the Fileupload library and jquery 3.1 In the example pattern that the…
-
0
votes1
answer332
viewsXamarin: Android app does not load Https images
Guys I’m developing a Cross-platform App in Xamarin and I’m not able to upload https images from an api. If I perform a compilation on Windows Phone the images are normally loaded already on android…
-
0
votes1
answer1126
viewsError accessing data in Mysql with EF6
When I try to access data in Mysql via lambda(EF), Visual Studio returns the following error: Falha no método >'MySql.Data.Entity.EFMySqlCommand.set_DbConnection(System.Data.Common.DbConnection)'…
-
0
votes1
answer74
viewsAdding value in the picturebox
I wonder if there’s any way to make it work here int chck = 0; int fid = 0; while (chck < 150) { try { sqlcon.Open(); string sql2 = "SELECT img FROM clienteimg WHERE ((clienteid = '" + cid + "')…
-
0
votes0
answers487
viewsVisual Studio does not auto-complete anything
I’ve always used visual studio and never had any problems. I have the community 2017 version installed, and I was using normally, however, I had to pause the development I had been doing. Now that I…
-
0
votes1
answer176
viewsProblem importing reference to EZ Commerce web service
Hello, I would like to know if anyone has already imported directly by Genexus the definitions for the integration webservices with EZ Commerce. My problem is that the EZ Commerce webservices…
-
0
votes1
answer37
viewsDoes not list database data correctly in View Asp.net
The data was entered into the database, but the View does not show one of the fields. I checked in SQL Server and it’s all right, but the name field returns empty in view public ActionResult Index()…
-
0
votes1
answer40
viewsGet parameter by url for my controller
I need my controller to get a parameter from a URL (localhost/Check/123456), where 12346 would be the parameter. I configured the Routeconfig: public static void RegisterRoutes(RouteCollection…
-
0
votes1
answer377
viewsAjax Jquery C#error request
I am getting error 401 in a simple Ajax query with Jquery. Request: $().ready(function () { $.ajax({ url: "Ajax/RetornoAjax.aspx/ObterResultados", type: "GET", //Caso não passe nenhum dado dataType:…
-
0
votes1
answer118
viewsQuestions on how to identify an object in the collection
I’m studying C# and I’m having some questions.. The project I’m doing is a fictional gallery system that registers the Artists, Curators and pieces of arts. I created the abstract class "Persons"…
-
0
votes1
answer102
viewsMVC5 + Entity Framework + Form + Modal
I have an application where there is a central entity and several other auxiliary registers, such as Status, Format, Type, etc. All these auxiliary entities have only 2 fields: Name and Status…
-
0
votes1
answer911
viewsReturn data from 2 Entity framework tables
I have the following table: Moving -moving -Clienteid -Productoid When I select a particular customer I want to list all drives in which they are along with the product. what I would call it inside…
-
0
votes1
answer681
viewsHow to fill a Dropdownliste with ASP MVC
Good afternoon, as I can fill a dropdown with data from a database using pure Ado.net (code) and without using Entity framework? I have two tables in my bank that relate. First I must register a…
-
0
votes1
answer930
viewsSystem.Nullreferenceexception: 'Undefined object reference for an instance of an object
I was trying to run my database but this error appears. System.Nullreferenceexception: 'Undefined object reference for an instance of an object. con era null using System; using…
-
0
votes1
answer218
viewsUpdate Dropdownlistfor in form
I have a form that has two @Html.Dropdownlistfor among other fields. However, when changing the first Dropdownlistfor I need to update the values of the other dropdownlist by passing its id as…