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
votes1
answer616
viewsHow to list items per logged-in user in Asp.net MVC
I have an application that manages Courses and I have the following problem, the pupil makes his enrollment in courses, only when the pupil access the page where lists the courses he is enrolled,…
-
1
votes1
answer93
viewsC# Floating Form
Good, I’m making a program where I need a floating form that accompanies the mouse cursor while it’s inside a button, so far I have this: private void portaSwitchUpLink_MouseEnter(object sender,…
-
1
votes1
answer32
viewsPagination with EF 7 Asp.net 5 MSQL 2008
Good morning I would like to know if anyone has any solution for paging using EF - Entity Framework for versions prior to MSQL 2012
-
1
votes1
answer206
viewsArgument data type xml is invalid for argument 1 of Len Function
I am mapping a property to the xml database using Migrations. public string Xml { get; set; } this.Property(t => t.Xml).HasColumnName("Xml").HasColumnType("xml"); However, when consulting the…
-
1
votes0
answers234
viewsController does not pass route value to View ASP.NET MVC
Based on my previous question: Problem with page return according to C profile# When accessing the system with another user with the "ADMIN" Profile, the controller’s return does not fall into the…
-
1
votes3
answers494
viewsProblem with a Boolean field on Asp.net MVC
My application that manages Courses has an area of Administrator where he approves a pupil in a course. That one field that Approves a student is a field booleano, I’m just having trouble with this…
-
1
votes1
answer717
viewsC# Entity Framework Invalid Object name 'sys.default_constraints'
In my C# MVC 5 project with Entity Framework together with an SQL Server, among a series of classes, I have a class called ctmdMandados.Cs: public class ctmdMandados { //cadastro dos mandados…
-
1
votes1
answer185
views -
1
votes1
answer175
viewscreate custom mask unity3D
How to create a date mask on the Unity 3D platform, so that when I type, it automatically places the characters "/"? Example: 00/00/0000
-
1
votes1
answer491
viewsWhat are the free libraries options for ASP.NET MVC PDF generation?
I am currently using the selectpdf library, but it has some restrictions on its free version, I would like to know other options that I can use.
-
1
votes1
answer887
viewsHow to generate a hash for the user password with ASP.NET MVC and . NET 4.5
I am implementing an authentication/user registration functionality with ASP.NET MVC 4.5, but I can’t find anywhere a more correct way to work with passwords in the database, I don’t want to simply…
-
1
votes1
answer721
viewsHow to generate a matrix of 3 columns where for each column there are 3 different possibilities?
The problem is as follows: In a vector I have 3 sets (A, B and C). Each set can have up to 3 distinct values(0, 1 or 2). This way I need to generate all possible combinations for this case, with…
-
1
votes1
answer46
viewsMake a loop for 2 cells by clicking
I need a loop for 2 Labels where each one appears a text already specified in the code. Just out of curiosity. I wanted a loop with the same effect as the code below: private void…
-
1
votes1
answer126
viewsRun a form (or create file) only when the program is first opened
I want to know if there is any way I can create a form to be opened only the first time the program runs. Because the form must create a file in the system with login the first time the program runs…
-
1
votes1
answer198
viewsChar Playermoviment Script Problem in Unity 5
Char Playermoviment Script Problem in Unity 5 Alleged problem on line 70 in "Quaternion" using UnityEngine; using System.Collections; public class PlayerMoviment : MonoBehaviour { //velocidade do…
-
1
votes3
answers38
viewsHow do I replace windows form Dialogresul in wpf?
I have that code: DialogResult dr = ofd1.ShowDialog(); Moving to WPF does not work. I searched the internet and found nothing yet, that satisfy me. As I replace in WPF? Note: ofd1 is a OpenDialog…
-
1
votes1
answer9903
viewsClose file (is being used by another process)
The code I am trying to use is the following (I modified only the path and the content), before these lines I do a check if the file does not exist, ie it only executes it if the file does not exist…
-
1
votes1
answer1342
viewsAvoid saving duplicate data
In my project I have a rule that is not to save and not to show in Grid duplicated data. For example, in the system I read a XML and with the exception of tags in a table in my database so that this…
-
1
votes1
answer183
viewsArray to solve hidden sentence puzzle
" You have two arrays letras = ["m", "D", " ", "e", " ", "G", "v", "e", "i", "e", " ", "r", "S", "G", "D", "u"]; caminho = [ 12, 7, 11, 9, 8, 4, 15, 0, 2, 13, 14, 5, 10, 1, 3, 6]; There’s a hidden…
-
1
votes2
answers399
viewsSort field or expired date notifications, database
I know nothing about database, I’m using one in Visual Studio (the standard SQL called "Service-based database"), I’ve integrated it into the form and made up the query fields. But there is a field…
-
1
votes1
answer1111
viewsDifference between Partial Render and Render Action
I would like a help to better understand these types of partial view rendering.
-
1
votes2
answers1576
viewsTake the value of a form that has a list
You guys all right? it’s me again, I know I’m asking a lot of questions, but I’m having a few questions and I can’t find an answer, I’m wanting to capture the event of a button in Asp.net mvc using…
-
1
votes1
answer35
viewsHow to allow an event to reach other UI elements?
I own a xaml that I apply a rectangle over several images, in order to be able to manipulate them after a holding on them. The problem is that if I put the IsHitTestVisible in a state false in the…
-
1
votes0
answers153
viewsWhat is the best ASP.NET MVC 4 authentication method?
I’m having doubts about how to implement a better form of authentication, which is safe and allows "sessions" or "cookies" with different names, making it possible to create an authentication method…
-
1
votes4
answers1276
viewsHow to get the amount of records from a Datareader?
I am doing a query in a database, but need to know how many records I will get from this query, before I even start crocheting. Note: I don’t want to put a counter inside the mesh, I need the value…
-
1
votes2
answers634
viewsStart multiple threads in a repeat command
I have a project where I need to start 30 times a thread which will run the same method, and wanted to do this in a repeat command, for example: for (int i = 0; i < 30; i++) { Thread t = new…
-
1
votes1
answer81
viewsHow to set Title in a`img`?
Is there any way to set the title (Text) of the component img in the code behind? <tr> <td colspan="7"> <img id="ProximoMes" src="../Images/Icons/dright.gif" /> </td>…
-
1
votes2
answers2213
viewsBest way to display a form within another form?
I’m in doubt here, I don’t know much about it. 1 I was wearing a form only, with several panel hidden within it, and when the user clicked on some option in the menuStrip I manipulated the…
-
1
votes1
answer79
viewsItems not being updated
I am creating a (several) combobox at Runtime and trying to manually set a SelectedValue 'standard', but I realized that even manually setting a value that exists inside the combo nothing is…
-
1
votes1
answer38
viewsMethod to create a new list based on elements from an existing list?
In c# there is the function numeros.GetRange(0, quant); I would like to know the equivalent function of numeros.GetRange(0, quant); of C# in Java
-
1
votes1
answer97
viewsHow can I create a screen with different views for report c#
is the following have a system that has some reports wanted to make a single screen (webForm) and as the user makes a report call the screen generates this report and shows on screen.
-
1
votes1
answer125
viewsLabel refresh auto
I wonder how I could automatically refresh a LABEL who is in a Master Page. That one Label shows the sum of the quantity of the products, and whenever I add a product to the cart Label does not…
-
1
votes1
answer331
viewsCheck that framework 3.5 is installed on the machine
I have to perform a function in C# to check that framework 3.5 is installed on the machine but not using Registry.LocalMachine.OpenSubKey("Software\Windows\Microsoft.NET\..."), because this function…
-
1
votes2
answers231
viewsEF 6 Code First: Decimal field gives error when trying to save
You guys, good morning. I have a class that has a decimal field where I keep the price. So far so good. When it is displayed in the /Edit/ page, also ta beauty. But here’s the problem: 1 - The MVC…
c# asp.net-mvc entity-framework asp.net-mvc-4 code-firstasked 9 years, 3 months ago Luiz Felipe 456 -
1
votes1
answer2412
viewsCheck if e-mail is valid?
I’m using this function to check: public static bool IsEmail(string strEmail) { string strModelo = "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$"; if…
-
1
votes2
answers57
viewsThere is a difference between connecting to the database using a class and the visual studio: Tools>Conect_to_database?
I am learning C# and would like to know if there is a difference between the two types of connection cited in the title. If so, which?
-
1
votes0
answers39
viewsCreate a web service that receives strings
I have to create a serviço web, that this service will receive two Strings, a phone number and a message, which should be "pasted" into a C# I have to fire a message.. That is, through another app I…
-
1
votes1
answer462
viewsHow to use Generic Method with Dapper?
I have 2 methods from a generic repository public TEntity ObterPorId(int id) { return Db.Set<TEntity>().Find(); } public IEnumerable<TEntity> ObterTodos() { return…
-
1
votes1
answer788
viewsMonodevelop from Unity says my variables don’t exist?
I was following the fourth video tutorials of Roguelike scavengers, and I came across these errors when I finished. In the fifth video it fixes some, but these continued, I am using the latest…
-
1
votes1
answer523
viewsHow to perform a C# CRUD with Mysql and ADO
I need to do the relationship between tables 1:N and N:N. Table produto: public int id {get; set;} public string produto {get; set;} public list<tamanhos> tamanhos {get; set;} Table tamanhos:…
-
1
votes0
answers52
viewsHow to Leave a Semi-static Component
I created a trackBar with 2 Thumbs by user control , but in the form.design if I drag the component changing the width , mess the trackbar , I wanted to take this option to drag to side , only…
-
1
votes1
answer485
viewsDoubt with binary tree
I have this question: Write a function that takes a tree and an id and returns an array of path ids from the root node to the node passed as parameter. int[] caminho_arvore(Arvore a, int n);…
-
1
votes1
answer641
viewsRemove border from WPF window
I have this window with an image defined as background, ok, but note that the image is not occupying the whole window. How can I remove these edges? Remembering that, the window is with the…
-
1
votes2
answers315
viewsRequest Validation Asp.net
I have a Textbox that uses the text editor ckeditor. When I run the method to save the information, it gives an error A potentially Dangerous Request.Form value was Detected from the client…
-
1
votes1
answer209
viewsCheckbox checked according to string
I have a string in the format ["0,1,0,1,0,1,0,0"]. Where 1 is checked and 0 is unchecked. I also have a grid where I still have a checkbox at the first Oluma. I need to mark the checkboxes according…
-
1
votes1
answer97
viewsENTITY FRAMEWORK - add-Migration New Project without renaming old tables
I want to share a database with some projects. I’ve already done the first project with the bank and it’s okay. I copied the project to create another similar one, changed the initial prefix of the…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 6 months ago Daniel Gregatto 1,054 -
1
votes1
answer424
viewsHow do I limit a character’s motion (Touch) to 3 specific points? Unity C#
I would like to know how to limit the position of a character in the Y axis in the Up, Mid, Down positions. In the game the character runs while obstacles arise and dragging his finger up, if he is…
-
1
votes1
answer233
viewsDoubts about the datagridview
Hello I have some questions about the datagridview of visual studio, I would like to know how I can change the values of the columns that appear to Foreign key of sql server by the value of the…
-
1
votes1
answer552
viewsHow to make a chart grouped between bars and lines with google Chart and export to pdf (C#, MVC)
It would be something like the image below: Vlw guys…
-
1
votes1
answer114
viewsWhat is the difference between Formsauthentication createPersistentCookie true or false?
In an ASP.NET Web Forms application that uses Formsauthentication on Login would like to know: What’s the difference in using Formsauthentication.Redirectfromloginpage with createPersistentCookie…