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
answer94
viewsThe "Mailaddress.Displayname" property or indexer cannot be assigned, as it is read-only
I can already send an email normally. I just can’t change DisplayName. Follows code : var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var…
-
0
votes2
answers179
viewsTool to generate poco
I have a postgre bank with several tables and I need to generate their classes. Is there a free tool that manages the pocos to be used with EF6? I searched but did not find. I am using VS2015 and…
-
0
votes1
answer367
viewsSave last value to variable and display
I’m having a problem in my program its function is to display on the screen how much ram memory the process is currently consuming and display the peak of memory usage, so my problem is when I close…
-
0
votes1
answer31
viewsIn savechages it says which column is null and has value
When I call my method to record, the whole object comes filled in, but when savechanges() is called it says that Idbalanca is null and yet it has the value of 1. Method Insert: public virtual void…
-
0
votes1
answer332
viewsJoin several values of type Iqueryable
I am receiving an array of values from my View with the days of the week. Sunday, Monday, etc. I want to compare this array with a string type attribute of my database and store it in a "Iqueryable"…
-
0
votes0
answers117
viewsBackup App - Online via Onedrive or Local?
Although this question is a personal opinion, it may help to several other people if we put the positive and negative points of every technology. I have a server in the USA, with link 1 Gbt/s Full…
-
0
votes1
answer35
viewsDoubt about vector
I am trying to list the numbers that the user type but am not finding the function,someone can give me a light? class Program { static void Main(string[] args) { int[] atividade = new int[6]; for…
-
0
votes1
answer559
viewsIs it possible to connect to a Mysql database without Mysql.Data.dll?
Whenever I will use a Mysql database in a console or windows Forms application, you need to have the dll MySql.Data.dll inside the application folder. With that, I wonder, if you have any way to use…
-
0
votes2
answers1699
viewsFind out if it is even or odd in array
I’m trying to define the even and odd numbers of a total of 5 numbers entered by the user in a vector. int[] atividade = new int[6]; for (int i = 1; i < 6; i++) { Console.WriteLine("Insira o " +…
-
0
votes2
answers482
viewsInsert time and time into database
I want to enter the time and date separately in the database, which have the fields timestamp and data, respectively. I have the following code on the insert button: SqlCommand sqlInsertCabecalho =…
-
0
votes1
answer127
viewsApplication sent twice the same message
I’m having a new problem with the skype library (skype4com). Actually there are two problems. I’m doing my application in WindowsForm (C#). I made an app to send automatic reply in skype. private…
-
0
votes1
answer80
viewsHow to Save All User Lists?
Hello is my first question here, I would like to ask a question. I would like to create a List that stores the user’s name, email address, password. Could someone help me? I thank you in advance,…
-
0
votes0
answers277
viewsIlist vs List , main difference
Does anyone know the difference between it ? When should I use IList and List Follows code: Ilist: public ActionResult Upload_Photo(IList<HttpPostedFileBase> file_photo) List: public…
c#asked 7 years, 3 months ago Matheus Miranda 5,375 -
0
votes1
answer169
viewsMaster page does not load in ASP.NET
My master page does not click on ASP.NET. I know why it does not load, I do not know how to solve. The master page is in a folder behind the page "Isaque.aspx". Code : <%@ Page Language="C#"…
-
0
votes1
answer685
viewsCamera does not follow character UNITY 5
Error in Unity Look rotation viewing vector is zero UnityEngine.Quaternion:LookRotation(Vector3 Codigo Inteiro using UnityEngine; public class PlayerMovement : MonoBehaviour { public float speed =…
-
0
votes1
answer768
views -
0
votes1
answer439
viewsList or Datatable desktop c#
I have an application used layers and I have a question... When the UI layer requests multiple records, it would be better to load the whole into a list<> or use the datatable? Today I use it…
c#asked 8 years, 7 months ago Fabio Zanardo 45 -
0
votes0
answers235
viewsMultiple Database Connections - Multi-task c# executable
I have an executable that I need to run a database giant. How the processing time would be unviable if I did it in a single Thread.... Following the idea of this question, I decided to create an…
-
0
votes1
answer58
viewsHow to pass more than one Controller option in Routes.Maproute()
I have the following route: routes.MapRoute( "Contracts", "Home/Contract/{contract}", new { controller = "Home", action = "Contract", contract = UrlParameter.Optional }, new { contract = @"\w+" } );…
-
0
votes2
answers120
viewstextbox saving in bank even if empty
Validation and message: if (txtFone.Text.Trim() == string.Empty) { MessageBox.Show("O campo Telefone é obrigatório!"); txtFone.Focus(); return false; } Save button code: if (this.Valida()) {…
-
0
votes0
answers47
viewsAbout packages via Reflection x Manually
Well, the title may not have been very explanatory, but I hope to improve on the content of the topic. I made a library in C# in which to date, manually writes packages, as in the example below:…
-
0
votes1
answer701
viewsWhat is the function of this Mainwindow file?
According to the project below: http://www.macoratti.net/11/06/pp_mvvm1.htm I know that the purpose of the Main function is to be the main function but in the example presented above the Mainwindow…
-
0
votes0
answers31
viewsJava virtual machine error in Xamarin project
I have an Android project that runs normally. However I created a Cross Platform and is giving this error: Error Could not create the Java Virtual Machine. Authorizer.Android C: Mobile Authorizer…
-
0
votes1
answer68
viewsHow to make a date in ISO 8601 format but still be a Datetime
I wanted to know how I can transform a Datetime into an ISO 8601 format but keep it in a type of Datetime
-
0
votes1
answer579
viewsHow can I add Headers to an Httpwebrequest
I am wearing var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://test.net"); to create a server connection and would like to know how I can add headers to the httpWebRequest?…
c#asked 7 years, 2 months ago Pedro Azevedo 435 -
0
votes0
answers182
viewsFullcalendar with Google Integration
Guys, I’ve used this component before in another project, now I was interested in using the integration with the google calendar. Has anyone used Fullcalendar https://fullcalendar.io/ with…
-
0
votes1
answer387
viewsRun the Submit of a form in an element click event
What is the best way to perform a POST at the click of a button in an Asp.net MVC form. View Create: @model Projeto.WebERP.EntityFramework.Entities.Pais @{ ViewBag.Title = "Create"; } <div…
-
0
votes0
answers112
viewsUpdate all open tabs in the brownser of an aspnet application mcv c#
Hello. I am developing an application and wanted when a user login or login to update all tabs that the application has opened in the browser. Example: User João is logged in to the tab 1. User…
-
0
votes1
answer45
viewsWindows Send To Menu by sending File Path
I am Developing an Application and my idea is to put this application from the send to Windows menu. I already managed to put the start of the Application there, but I can’t get the file path.…
-
0
votes0
answers42
viewsCan’t Convert error to color: type=0x2
In Xamarin, when debugging the application, this error appears Can’t Convert to color: type=0x2 in the method SetSupportActionBar(...); Excerpt: Android.Support.V7.Widget.Toolbar myToolbar =…
-
0
votes1
answer328
viewsIf the user enters such number in the console will do an action
How do you when the user enters such a number in the Console will do an action? For example: Console.WriteLine("Escreva 1 para acontecer algo, 2 para acontecer outra coisa"); In case I don’t need…
c#asked 7 years, 2 months ago Leonardo Araujo 55 -
0
votes1
answer57
viewsError saving to bank
would like a help. When I try to save the records, the following message appears: 23502: null value in column "id" violates not-null Constraint The primary keys are not auto-increment, I’m using a…
-
0
votes0
answers110
viewsHow do I check if a password is correct in an ATM project?
I have a college job where I need to create a kind of ATM in C#, where I have to create two textbox in which I have to enter a four-digit password in the first, and fix the same masked password in…
-
0
votes0
answers92
viewsDataset or Datareader? - C# NET programming
Data-driven projects are widely used in desktop applications, I’m with a library project that saves member records. I’m using the method of Application in 3 layers, consists of a lot of efficiency…
c#asked 8 years, 7 months ago Ronan Silva 360 -
0
votes1
answer53
viewsSaving information in the same database attribute using two textbox
I was wondering if there’s any way I could save two different pieces of information into the same attribute in the database. Like I have two textbox, one Cpf and one cnpj. I wanted to save Cpf and…
-
0
votes1
answer212
viewsPlay Values from one Datagridview to another Datagridview
Good evening guys, I’m having a problem. I have a datagridview that is connected to the bank. I Fis a filter on this normal grid. Now I want to take the filtered values of this grid and play in…
-
0
votes1
answer758
viewsInsert date and currency data of a maskedTextBox into Mysql
When trying to enter the typed data of an object maskedTextBox, one of the date type and another of the currency type, in the Mysql database, where I have a table called test, created as command…
-
0
votes0
answers287
viewsHow can I get information from a datagridview to use in another form
I am making a program in c# and I have a datagridview at Form1 and I have another datagridview on Form2. How can I get the selected cell from the datagridview that is in Form1 and use na as a…
c#asked 7 years, 2 months ago Pedro Azevedo 435 -
0
votes1
answer321
viewsEntity Framework - Objectstatemanager Error
I am getting the following error when trying to update an entity in EF: {"An object with a key that matches the given object’s key could not be located in the Objectstatemanager. Check that the key…
-
0
votes1
answer398
viewsHow to run programs without specific path
Example: I want you to automatically do a search of the program I write, and if you find an application ". exe" it run it, if not find, send a message saying that the program is not installed on the…
-
0
votes1
answer475
viewsProblem with string to decimal conversion c#
Hello, I’m having a problem with string to decimal conversion, as demonstrated by the following code: string valor = "0,01"; CultureInfo _provider = new CultureInfo("pt-BR"); decimal valorTratado =…
c#asked 7 years, 2 months ago Alexssandro Rocha Aquino 9 -
0
votes1
answer974
viewsWhat is the [Httpget] statement for?
In a certain method of mine Controller raised in the Asp Net MVC, I learned that I could put the statement [HttpGet]. In other cases, as in my models, I realized that can be put too [Length(10)] and…
-
0
votes1
answer1535
viewsDate format problem (mm/dd/yyyy)
I have an ASP.NET Core application and can’t find a solution to my date format problem. My application, is published on a Microsoft Azure server, which is probably in the US (although it appears…
-
0
votes0
answers32
viewsComposite key navigation
Hello, I have a class with 2 keys composed public class Produto_Empresa { [Key,Column(Order = 0)] public int id_produto { get; set; } [Key, Column(Order = 1)] public int id_empresa { get; set; } } I…
-
0
votes1
answer1197
viewsBoleto.Net Component Generating Wrong Code
I am working with the boleto.net library, I am generating billets from the bank of Brazil and I am experiencing the following problem. I am generating the billet but the barcode of the billet is…
-
0
votes1
answer42
viewsSpecsync4mtm problem
So guys, every time I try to run the specsync4mtm.cmd send me 'C: Users zidan Onedrive Visual Documents' is not recognized as a internal or external command, a operable program or a batch file.' I…
-
0
votes1
answer65
viewsAdd Action and Controller to Beginform’s Htmlhelper with T4
I need to add to my template in T4 the value of action and of controller, but I can’t understand how I can pass their names. Following example: CREATE.cs.T4 @using (Html.BeginForm("Create",…
-
0
votes4
answers8648
viewsRemove space and break string lines
I’m making a Webapi that generates an XML, this XML is read several times a day, so in the first run it serializes all my XML and saves it to disk, and during 24h it reads from disk instead of…
-
0
votes0
answers19
viewsWaiting for a page to load
I have a home page, and when I click a button, I navigate to the next page. The problem is that this page does a database query and returns many records, which are inserted in 3 listviews different.…
-
0
votes1
answer2293
viewsHow to consult cnpj using Httpwebrequest?
The thing is, I’m creating a program to perform CPF and CNPJ queries on the IRS website. It’s not an attempt to circumvent the system. I’m bringing the captcha to a Picturebox so that the user can…