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
answer71
views"Node is read only" error when trying to encrypt XML
I am trying to encrypt using XML, while running returns this error : the Inner text of Document Node is read only and cannot be set! Error happens on line xmlDadosCartao.InnerText =…
-
1
votes1
answer3016
viewsDropdownlist with invalid Selectedvalue because it does not exist in the item list
I cannot understand what is wrong. Dropdown is in a Formview of a user control. The dropdown links to a database table that should return 2 id and name values Formview <td><asp:DropDownList…
-
1
votes1
answer138
viewsPreview the data before saving to the database
I’m doing a news site on ASP.NET MVC 5 and the need arose to see the Preview of the news before saving it in the bank. With a action by name Preview I can send the data to her and send it to a View…
-
1
votes1
answer325
viewsChange password Student
In the student environment, they must change their password. I created the code below but can’t get results in the bank. Someone notices something wrong? [HttpPost] public ActionResult…
-
1
votes1
answer910
viewsHow to group my Data Grid by modules?
How can I group data in my Datagrid? For example It would have as I group these values and add them in a Datagrid more or less as I described above?…
-
1
votes2
answers7317
viewsHow to create user with encryption password?
As I do in my ASP.Net MVC 5 and EF 6 application to save encrypted passwords in MD5 format when creating users?
-
1
votes1
answer8336
viewsHow to break a label line automatically?
= .NET Framework 4.0 = Visual C# I have a problem with Labels, when I assign a value to the property text and this value is very large, it "breaks" its container, going beyond the edges, with this,…
-
1
votes1
answer187
viewsDisplay blocked user message on Membership
I need to display a message when the blocked user tries to log in to Membership... I set the locked user with the Isapproved = false property; at the time of registration MembershipUser lockUser =…
-
1
votes1
answer332
viewsUsing Navigate to upload more than one link to Webbrowser
How to do the Navigate go to the next link after the first one has loaded? I’ve tried a few things but failed. nomedobrowser.Navigate("http://reidocrime.com/");…
c#asked 10 years, 4 months ago Fernando Neves 117 -
1
votes1
answer1104
viewsJoin with lambda Expression only
With LINQ no problem. Now, how do I make a join with two or more tables? Below the attempt of the join that I couldn’t go through with. Two tables(T_Acao and T_ProximaAcao). Field in join is the…
-
1
votes1
answer73
viewsAction Does Not Perform
I am using STS authentication, and given certain configuration in web.config I can’t get my (Sign In) action to perform what it should. to elute follows code: [AllowAnonymous] public class…
-
1
votes1
answer74
viewsScreen touch recognition such as Mousedown
I’m developing a game (Puzzle) in C# Winforms, to run on a touch screen. The mapping of touch events to mouse events already occurs by default, and I didn’t have to do anything to make it happen.…
-
1
votes2
answers1083
viewsLoad a type list into a View of another type
I’m doing a professional registration and of course, my View is typed with this Model. But in the register I need to insert Specialization and Type (other 2 different models). These last 2 models…
-
1
votes1
answer728
viewsList Human Interface Devices using C#
I am facing difficulty in figuring out how to list and access a device on PC, remembering that although the entry is USB it is recognized as a HID human interface device type mouse or keyboard. Well…
-
1
votes1
answer54
viewsAdd items to a dropdown control connected to a database
I have a control dropdown connected to a BD and wanted to add an item to force the user to choose an option. How can I add another item (choose/select/----------) to the control in order to force…
-
1
votes2
answers147
viewsUse lambda with Ado.Net
Using sqldatareader and ado.net, can you use lambda with Linq or just lambda or just Linq? This is not a multiple question, but Lynx and Lambda are always together, so the various "?" okay?
-
1
votes1
answer1437
viewsLearning to use AJAX in ASP.Net MVC 4
In my project, I have two models different, generating with this, their controllers and your views. Only what happens is that I don’t know how to use AJAX and urgently needed a help from you. What…
-
1
votes1
answer58
viewsC# Stream.Beginsend
As you can see in the link below, the Streamreceiver method uses the Beginread method to read asynchronously, whereas the Senddata method does not use asynchronous writing, which is the logic to…
-
1
votes1
answer412
viewsEntity with simple key referencing another with composite key
I am using Fluent Nhibernate for mapping my classes, and I have the following situation: User class public class UsuarioMap : ClassMap<Usuario> { public UsuarioMap() { Table("USUARIOS"); Id(x…
-
1
votes1
answer436
viewsDoubt in View and Controller construction with cardinality dependent entity N
I am on a project that I have a relationship of 1:N. Explaining better: Project is for a school where there are students and their occurrences. Then you would be a student for several occurrences:…
-
1
votes1
answer154
viewsBank table does not update
I have in my database some tables they already contain data saved, but I am not able to update this data. I have the method below that performs the insertion of a new item in the table if the table…
-
1
votes3
answers522
viewsReceive backgroud-image attribute from a div
I’m trying to get paid like this: var obj = webBrowser.Document.GetElementById("senderscore").GetAttribute("background-image") but it returns empty. The field background-image of div contains a url.…
-
1
votes1
answer58
viewsFeed view fields to controller
I have used a way to load fields in the view as follows: I make a method by returning a Json in the controller, then create a Jquery function that takes this return and feeds the view fields, in the…
-
1
votes1
answer33
viewsError:Build Solution - Visual Studion
When trying to build the solution VS2013 presents the following error: Error 1; Could not copy the file "obj/Debug/Win8appbox.exe" because it was not found. I noticed that the file . exe is deleted…
-
1
votes1
answer1953
viewsDynamic Linq Query between two contexts
I’m trying to return the query sql sequinte but without success. SQL= select IDEstado, COUNT(IDEstado) from PessoaEstado w join Nucleo.dbo.Estado e on e.ID = w.IDEstado where IDPessoaMaster = 46…
-
1
votes1
answer188
viewsAccess to Mysql database via the/net connection
I am developing a system that will access the Mysql database only to query data. I referenced the mysql.data.dll and I’m using access through Mysqlconnection. It turns out that the system is…
-
1
votes2
answers3772
viewsGridview Get Textbox Value
I intend to obtain the value of a textbox of a gridview. This Textbox is created by RowDataBound. As follows: TextBox txtValor = new TextBox(); e.Row.Cells[i].Controls.Add(txtValor); For the…
-
1
votes1
answer389
viewsDatabase entry error, how to solve this case?
I am trying to insert a form with various data, some booleans, radiobuttons, datetime etc. I need to know if everything is correct, I am picking them up via FormColleciont. Controller: [HttpPost]…
-
1
votes1
answer562
viewsFilling with Dynamic Templatefield
I dynamically create the templatefield to my gridview, when I get to gridview is rendered, I get the error that the "C" element does not exist as column names. The code that error occurs is:…
-
1
votes1
answer65
viewsDelete From does not work on C#
Why the code below does not work (does not delete)? using (Banco db = new Banco()) { String strSql = "Delete from Cliente where codcliente=" + Session["_uiUserID"]; db.Cliente.SqlQuery(strSql);…
-
1
votes1
answer183
viewsError 500 in Asp.Net Awesome Library
I found browsing the internet this library ASP.net Awesome. I found it very functional and easy to use. According to the documentation to use a helper called Lookup, you need to have a controller…
-
1
votes1
answer72
viewsTimeout Httpwebrequest Second time
public static bool Sinc(int v, out List<Ma> x) { try { XmlDocument urlData = new XmlDocument(); HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://192.168.1.155/Ser.svc/maq/?v=" +…
-
1
votes2
answers93
viewsHow to use Window.Clientbouds inside a class in XNA
I’m having a hard time delimiting the character’s movement to the edge of the screen. In class Game1 which is my main I can use Window.ClientBounds, but when I use this function within the class…
-
1
votes1
answer1710
viewsPass parameters by jquery through a table
a question: I have a table and in it two columns, which are: CNPJ and Razão Social. Well, I need to do this: When I click on the column CNPJ, for example, should pass the value of CNPJ that is being…
-
1
votes1
answer138
viewsHow do I send html from one view to another view?
I have a view (View1.cshtml) with filters, a whole layout and a graph within a div that is generated according to the filters. I created another view (View2.cshtml) in white and I would like to pass…
-
1
votes1
answer474
viewsHow to present app in full screen / fullscreen on Windows Phone 8.1?
I want my application to run in full screen mode. I have tried using the codes below, however, are giving some errors. The code is not recognized by the emulator: <phone:PhoneApplicationPage ...…
-
1
votes1
answer622
viewsHow to do random image uploading?
How do I randomly upload images to the background of a app, so that each time the user enters a given page the background changes between the images ? How should I proceed to do this?…
-
1
votes1
answer440
viewsWebapi view content in a view
Hey, guys, all right? I am developing my first application in web api asp.net. And I’m having trouble displaying the content on a view. Controller: public class ListaPresenteController :…
-
1
votes1
answer62
viewsI can’t get into the comic book with Entity
This is my input code. Why is it wrong? What should I do? public int abreOsParceiro(string os, string cnpj, string dataAbertura, string dataVisita, string tecnico) { WEBEntities db = new…
-
1
votes1
answer70
viewsConnection name with Entity is out of standard
Whenever I change the database, I need to delete edmx and recreate it, because the update from database is not updating. So far so good. What happens is that he has now created a connection with the…
-
1
votes1
answer262
viewsEntity framework does not create mdf file
In my ASP.net MVC5 project he creates the default database by Visual Studio 2013. I went to the App_data folder and deleted the database mdf file, as well as the log file. I’m wanting him to create…
-
1
votes1
answer206
viewsModify default source
It is possible to modify the default font of my Windowsphone 8.1 application? Because I do the font change, inside Visual Studio is the font I chose, but when I run on the device the font this is…
-
1
votes2
answers921
viewsRecover Data Redirectaction mvc#
I have a student consultation, // POST: /Admin/Anuncio [HttpPost] public ActionResult Index(Estudante estudante) { if (ModelState.IsValid) { List<EstudantesEncontrados> list =…
-
1
votes1
answer2070
viewsAssign value to an object property by a list of objects
I have a list of objects: List. Well, this object has three properties, say, cnpj, acao and novaacao. I did a lick or lick and brought me all the results, let’s say two lines. I do a foreach on the…
-
1
votes2
answers84
viewsIs there a LINQ method that returns a default value of my preference?
Is there any LINQ method that returns a default value of my preference, which fulfills the role of this method in a more efficient way? public static int? procurarIdPorCpf(string cpf) { using…
-
1
votes4
answers1784
viewsConfirmation of sending email?
I need to send emails to my company’s customers, but I also need to know if these emails have been successfully received. Got some way of doing? Which would be the best? It would be something like…
-
1
votes1
answer102
viewsWindows Phone, how to import data (Isolatedstoragefile)?
Is there any way I can import a data file (txt) into Windows Phone’s internal memory using "Isolatedstoragefile"? I need to import a list of customers, and be able to edit by the device.
-
1
votes2
answers721
viewsHow do I direct an Action to a view inside a folder?
In my Ugcontroller I have an Action named Register that takes me to the View Register.cshtml that is in the UG folder. That is to say: Controller: UGController Action: Cadastro() Link: /UG/Cadastro…
-
1
votes1
answer896
viewsIncrease line height of a gridcontrol devexpress
Gentlemen(s), I have a gridcontrol of devexpress(12.1) being filled by a list, and I need to increase the line if the text is larger, and I need to do this dynamically (if the text fits the width, I…
-
1
votes1
answer124
viewsJava Database Authentication generated by Asp.net MVC 5(Generate passwordhash in Java equal Asp.net MVC 5)
I need to authenticate an automatically created user in Asp.net mvc 5 using the java language for example: user: so-and-so password: Ab123456 Password recorded in the Database PasswordHash…