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
-
1
votes0
answers78
viewsBlock coding
I’m trying to develop an application of Block coding. I found it difficult to develop this type of application. With the events below, I can identify when there is a collision between other controls…
-
1
votes1
answer944
viewsReportviewer with Subreport - Error processing subreport
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == true) { Sipom.DataSets.RelatorioTableAdapters.TodasTabelasTableAdapter Tabela = new…
c#asked 8 years, 11 months ago Vasconcelos Vanderson 13 -
1
votes1
answer642
viewsConfirmation of data Registrations E-mail Password
would like to know the best way to validate E-mail and password, to check if the user has typed the information correctly. Ex: Enter your e-mail address: Confirm your e-mail address: Enter your…
-
1
votes2
answers763
viewsWhat is the best way to read a sql server error return?
How best to read an error return from sql server in a C# web form application? I got the following.. No sql server; END TRY BEGIN CATCH Raiserror('Erro ao gerar os dados', 18, 1); return; END CATCH;…
-
1
votes0
answers75
viewsParallel calculation using Geforce Cuda
I have the following method that calculates the value of PI in a serial way: public static double CalculoPISerie() { double integral = 0; double h = 1.0 / NUMERO; for (int i = 0; i <= NUMERO;…
-
1
votes1
answer52
viewsAssign HTML code to a Jquery Alert
I am using this Alert but wanted to insert a text break window.alert("Não existe produto cadastrado no sistema! Para continuar devemos cadastrar pelo menos um produto"); wanted for a line break…
-
1
votes1
answer107
viewsEntity Framework + Fluent API + Web API?
I’m having trouble mapping the category within a product, when I list the products in the category (virtual class) comes empty, even with CategoryId filled. Product public class Product { public…
-
1
votes1
answer1302
viewsOpen external application as a child form in C#
I am needing to call an external application by my current application, in which this external application is being opened outside of my application and I would like it to be opened as a child form…
-
1
votes1
answer1559
viewsHow to do a back post (refresh) on MVC
I am new to MVC and am used to web Forms and the events of the controls that cause postback and update the page. I need to do this update on the MVC page after a javascript is triggered. In the code…
-
1
votes2
answers477
viewsView Ocutar Password using Editorfor
I’m using Labelfor, I wanted when clicking above to enter the password, displayed the characters, and when clicking outside was hidden, how could I do? <div class="form-group">…
-
1
votes2
answers3152
viewsremove mask to save to database
I am using Maskmoney to create a mask in the field for the user to type. wanted to remove the mask, saving only the numbers and the comma (2 decimal places) in the bank. R$ 1.300.000,00 saving only…
-
1
votes1
answer247
viewsEditing content from Div
I have a index, that displays the data from my database, wanted to click on the div, open a modal, which allows changing that div. Code of view: <div style="float:left;…
-
1
votes0
answers866
viewsHow to list data with Inner Join with mvc 5, c#, Dapper, and sql server?
I’m having the following difficulties: 1 - Data display from a select with Inner Join. The fields of the other tables do not appear all that are in select, and the ones that appear, have the value…
-
1
votes2
answers730
viewsHow do I checkbox Asp.net mvc database
Hello. I’m doing a project for a music player. In the Playlist register, I would like the songs to appear in checkbox so I can mark the desired ones and save in the database. This is my controller:…
-
1
votes1
answer1477
viewsException 'Input character string was not in an incorrect format' when calculating
I’m trying to do this calculation by using C#: ((x+50)/100)*50(x²-5x+8)) I did it this way: double Morte = ((int.Parse(TextBox1.Text) + 50) / 100)…
c#asked 7 years, 10 months ago Mario Segalla 11 -
1
votes1
answer4056
viewsLogin screen with C#database!
Eae, guys! So... I’m pretty new to programming and I’m having some problems with the database login screen. The code does not give any error, but it is as if there was no user registration in SQL…
c#asked 8 years, 11 months ago Oliver Gant 13 -
1
votes1
answer110
viewsDisplaying Bitmap in C#application
I have the following code in my application : Bitmap original = new Bitmap("C:/Projeto/Imagens/antialiasing.jpg"); Graphics g = Graphics.FromImage(original); g.DrawImage(original, 100, 100, 390,…
-
1
votes1
answer90
viewsHow does foreign key in c#?
I have two tables Contact(Man) and Woman. A man can have several women and a woman is for a man. public class Contato { public int id { get; set; } public String usuario { get; set; } public String…
-
1
votes1
answer656
viewsFill in a Dropdown (Select)
I need to create a select In this pattern: <select id="Cidades"> <option></option> </select> Where the user will select its state, and then a jquery will be made that…
-
1
votes3
answers1667
viewsAvoid duplicated list data
I need a list of musicians without repetitions, however it is bringing duplicate values, according to the amount of songs that each Musician has, how do I to be brought only one Musician? public…
-
1
votes0
answers30
viewsCreate Partial for Table
I would like to create a partial (to be called as @Html.Partial) by receiving the table id and a data collection. However, it would have to be completely independent. The part of C#, with…
-
1
votes0
answers31
viewsVisual bug using Longlistselector (grouped) and Checkbox Windows Phone 8
I am developing an application that has a grouped list, and within each item of the list there is a checkbox. The problem that has been occurring occurs when the checkbox of the first item in group…
-
1
votes1
answer40
viewsActionlinkbutton Boostrapmvc - Passing values to controller. "MVC - C#"
I’m trying to create a button with boostrap mvc, which when clicked will open a new tab with the data I want, but for that I need to pass an id to my controller, someone could help me because I…
c#asked 7 years, 10 months ago Samuel Renan Gonçalves Vaz 720 -
1
votes1
answer223
viewsDefine model the two-dimensional Array type attribute
There is a way to create an attribute of type array two-dimensional no Model so you can use this attribute to mount a table in View. Example: No model define an attribute of type array…
-
1
votes3
answers2001
viewsError trying to send email
I am trying to send emails (using my Hotmail account) and am encountering the error below: A connection attempt failed because the connected component does not replied r ncorretamente after a period…
-
1
votes1
answer111
viewsMappingnhibernate
How do I map a table that has a composite key in Nhibernate? For example: I have a table called configuracao. This table has a reference to the table local_estoque. Normally a map would look like…
-
1
votes1
answer507
viewsDifficulty in passing a parameter to a rdlc I have (Oracle)
I am unable to pass a parameter to my report. I have a field called Regulated, referring to the Ind_regulated field. see the code below and how I make this filter? public static void Emitir() {…
-
1
votes0
answers37
viewsWhat is the difference between Jagged arrays and multidimensional arrays, and what application is indicated for each one?
I would like to better understand the difference between Jagged arrays and multidimensional arrays, and how each type should be applied in practice.
-
1
votes1
answer1059
viewsMinefield, random bombs
Good afternoon I’m having some trouble using the method random to try to appear only 10 bombs in my minefield, only that it appears without limits. someone knows where I am missing? using System;…
c#asked 8 years, 11 months ago Rafael Soares 11 -
1
votes1
answer680
viewsHow to return query by a string using Webapi?
I have the following code that gives me an error: The inline Constraint resolver of type 'Defaultinlineconstrainaintresolver' was Unable to resolve the following inline Constraint: 'String'.…
-
1
votes1
answer144
viewsURL by Viewbag
I wanted to run a URL through Viewbag, but I couldn’t. I wanted to do it: ViewBag.Quantidade = "Você Não tem quantidades suficientes, para continuar você deve comprar um Pacote"; ai in case the text…
-
1
votes1
answer61
viewsJoin for 2 tables
How do I use the Join method to give a include of a value from another table? In this case I was going to use the Chamadamusicas table and the Musicavotadas table var chamadaMusicas =…
-
1
votes1
answer65
viewsProgrammatically change the date displayed in a "Datepicker" control?
I’m trying to display data from a table field MySQL in a control DatePicker. The code is as follows:: if (dataGridProdutos.SelectedIndex != -1) { DateTime selectedDate; DataRowView selectedRecord =…
-
1
votes2
answers233
viewsHow to know how many "black" pixels you have in a letter x, using an x font?
The question already says it all, in the way I was doing, I wrote several characters, printed and put the program to tell from one to one :/
c#asked 7 years, 10 months ago Ícaro Dantas 1,088 -
1
votes1
answer140
viewsFor nested in parallel
I’m trying to spin two for nested. The second would like it to be parallel. It follows my code. for (int i = 0; i < original.Width; i++) { Parallel.For(0, original.Height, j => { Color…
-
1
votes2
answers1205
views@Html.Actionlink and Url.Action are not taking the route of the controller annotation
I have the following method in control: [Route("video/categoria/{categoria}/{page?}/{sort?}")] public async Task<ActionResult> Index(string categoria, int? page, string sort) { ... } My…
-
1
votes2
answers403
viewsHow to include a new right icon in an Activity Xamarin Forms
It is possible to include a new icon in a activity but the right, without changing the existing ? I need to include the user photo on the right. (Red spot on image) Imagery:…
-
1
votes3
answers292
viewsEntity Framework 4 - Migrations error: The ... type is not defined in the <namespace> namespace. Map (Alias=Self)
I have a problem in mapping my application. [EDITED] Follows the Complete Datacontext Class: using System; using System.Collections.Generic; using System.Linq; using System.Web; using…
-
1
votes0
answers126
viewsError org.xmlpull.v1.Xmlpullparserexception: expected: START_TAG
Good night, you guys! I’m developing an android application that should connect with a c#webservice, but I’m having some problems connecting with my webservice. When I put the W3c webservice to test…
-
1
votes1
answer119
viewsHow to convert string to Fileimagesource(Icon) Xamarin Forms
How to convert a string(Image) to FileImageSource(Icon) ? I need to display a photo on ToolbarItems in the right corner of the hamburger menu. I tried that way, but it didn’t work. My code:…
-
1
votes1
answer857
viewsHow to save the PDF generated by reportviewer to disk at runtime?
I am making a series of reports which I need to generate the PDF and save to the server, for the user to download. I cannot use the mode atatchment and neither inline. Because the user has the…
-
1
votes0
answers34
viewsI don’t have the option to delete from the project to a Folder and its files
We used to have our own Nuget to install our DLL’s and so on. Well, now we no longer use Nuget. It turns out I downloaded a project from the repository to fix a bug, it asks for Nuget.exe. As I…
-
1
votes0
answers103
viewsApply rotation only on X and Z axes
I’m trying to rotate an object only on the X and Z axes, keeping the original value on the Y axis, but this way the rotation just doesn’t work, or gets totally misaligned. RaycastHit hit; if…
-
1
votes0
answers42
viewsIs it possible to make an array of arrays?
In a 3-column datagridview I need to scan all n rows and save them all in an array (or any collection) where each index contains the information for each datagrid row. Something like: meArray[line1,…
-
1
votes0
answers1006
viewsError reading byte array passed as parameter
That is the mistake: The input is not a valid Base 64 character string, as contains a character that is not base 64, more than two characters from or an illegal character between the characters of…
-
1
votes1
answer531
viewsSerialize/Deserializar Datetime
I am saving in text file a serialized object that contains only fields of type Datetime, however, the date is saving in the wrong way. I will demonstrate with an example what I am doing. My…
-
1
votes1
answer169
viewsVery difficult to mount an update with Linnus
I’ve done some updates with Ingles no problem. but the way my code is, I’m having trouble. What’s the rule: 1) I have a screen where I do some reporting requests. Soon I may have n requests in…
-
1
votes2
answers119
viewsCalling an Accountcontroller function
I am trying to fetch the logged in user ID this way: public int CurrentUserID() { return Convert.ToInt32(User.Identity.GetUserId()); } This method is in AccountController and I want to call it any…
-
1
votes1
answer255
viewsHow to write data in one table for many?
I have a question that still persists after making some searches. Is the following, assuming I have a form, where I register several emails to a single user, how I record these several emails in…
-
1
votes2
answers2016
viewsSending Model to Controller via Ajax
I have a strongly typed View with a small form and a javascript function with ajax: function emitir () { $.ajax({ type: "POST", traditional: true, url: '@Url.Action("EmissaoRapida", "CND")', data: {…