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
answer2218
viewsOpen Modal Popup from another aspx page
How do I open a Modal Popup extender from another page? I am using a User Control to create this popup: Usercontrol ucModalInativar.ascx: <%@ Control Language="C#" AutoEventWireup="true"…
-
0
votes1
answer65
viewsRemove Spellcheck (Check Spelling)
I need to Remove Spell Check Field from Edit Toolbar, but I can’t find any property or how to remove the field, I’ve removed all the buttons I didn’t need but I can’t find the reference of this, how…
-
0
votes2
answers122
viewsInvalidoperationexception when using the Databasecontext Set method
When using the Dbcontext.Set() method, the following exception is raised: The Entity type is not part of the model for the Current context If I create a Dbset directly in Databasecontext, it works.…
-
0
votes1
answer350
viewsHow to change the name of the References column by Fluent Nhibernate?
In the "LOG" class, I am trying to enter the column name, which is a FK, using Fluentnhibernate References. I have the following class structure: public class Pessoa { public virtual int Id { get;…
-
0
votes1
answer15042
viewsObject reference not defined for an object instance. in an object declaration
There is an error in my code only when I publish, when debugging works normally. the error is as follows: "Undefined object reference for an object instance." my code: MkfFile file = new MkfFile();…
-
0
votes2
answers80
viewsSerialize xml output to class
I have the following list of XML data: <xml> <cnt>7469</cnt> <emails> <item> <to_email>[email protected]</to_email> <id>3352143303</id>…
-
0
votes1
answer17194
viewsUndefined object reference for an instance
"Undefined object reference for an object" instance I have this problem here in my project in Asp.net and I have not been able to move forward with it for a long time, please would you take a look…
-
0
votes1
answer112
viewsHow to save selected fields in a C#Checklistbox?
My program contains two CheckListBox: the chkLstBoxTabela contains the tables of my comic book and the chkLstBoxColunas contains the columns of the table selected in chkLstBoxTabela, so that when we…
-
0
votes0
answers43
viewsHow to OPEN a file that is in an array of bytes?
The situation is as follows: I have a database where I store some files in bytes array (these files are OUTLOOK E-MAILS of the extension .msg). The purpose of this is nothing more than this: When I…
c#asked 9 years, 11 months ago Lucas Vasconcelos 199 -
0
votes1
answer91
viewsActivity does not open
Well, I created two Activities when I clicked on the button of the first one it should open the second one with information received from the first one. But that’s not what happens, where I’m wrong?…
-
0
votes1
answer4278
viewsMy view does not starta
This is the Error that gives: Erro de Servidor no Aplicativo '/'. Não é possível encontrar o recurso. Descrição: HTTP 404. O recurso que você está procurando (ou uma de suas dependências) não pôde…
-
0
votes1
answer557
viewsHow to prevent browser from displaying previous alert and resend information?
Work in a WEB application . aspx that saves data in the database. The problem is that after recording this data and displaying a successful information to the user, if I do a Reload on the page the…
-
0
votes2
answers1253
viewsHow to prevent duplicate registration/name change/social reason
In a register, c# windows form, where I use CPF s or CNPJ s, which is the best way to prevent duplicate names/social reason in inclusion or change. For example it may happen that in the change the…
-
0
votes2
answers780
viewsError while consuming ASMX Web Service
That is the mistake: An exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.ni.dll but was not handled in user code Additional information: The remote…
-
0
votes1
answer955
viewsSynchronize databases via Webservice C# Asp
I have databases on the server and on the client and would like the changes made in one to be sent to the other via a Webservice. For example, a new row is added to a table on the server, then this…
-
0
votes1
answer210
viewsError returning data using Fluent Nhibernate (Many to Many)
I have a relationship of many to many (M:M) using Fluent Nhibernate: Class/Map - Unit: public class Unidade { public virtual int Id { get; set; } public virtual string Descricao { get; set; } public…
-
0
votes2
answers306
viewsSplash Screen in Windows Form C#
So far everything is fine, but I did one splash screen and put the same to rotate in form and ran perfectly. After a while I always updating the project with new functions and the main splash…
-
0
votes3
answers558
views -
0
votes1
answer141
viewsSplit slides into Diferrent ppts
I am using the project "Powerpoint Add in 1" in Visual Studio 2013, and I have the following problem, I have a . ppt with 2 slides, I need to separate these 2 slides into different presentations so…
-
0
votes1
answer2145
viewsHow to limit characters in a textbox
How to limit the number of characters in a Textbox in xaml and via code behind?
-
0
votes1
answer6129
viewsHow to send NFE XML by consuming the SEFAZ web service
Recently colleague Rafael Corazzi posted a routine to send XML consuming the Sefaz webservice. At one point in the routine, it instantiates a class: SefazWebRequest request = new SefazWebRequest();…
-
0
votes1
answer805
viewsHow to call the Selectedindexchanged event a method
As I call the Selectedindexchanged event of a Dropdownlist in another method. Webform usage.
-
0
votes2
answers1026
viewsMove image (Picturebox) in form
How to move an image in a windows form. I used the following code: private void button1_Click(object sender, EventArgs e) { int tamanhoFundo = picFundo.Width; int x = myPic.Location.X; int y =…
-
0
votes1
answer347
viewsPopular a List with database data accessed by Entityframework
As popular as mine List, in C#, with the data stored in the database accessed through the Entityframework? Current code: public static IEnumerable<Contato> GetAll() { return new…
-
0
votes2
answers87
viewsAdd new Controller
When adding a new Controller in my project using the option MVC 5 Controller with views, using Entity Framework I’m having the error there was an error running the selected code generator, according…
-
0
votes2
answers485
viewsForeach within a cshtml
It is giving error the way I did foreach. If I put @ gives error in parser. If I withdraw gives other errors. How do I do? Below me full code. @model Ruptura.Models.RupturaEntities @{ ViewBag.Title…
-
0
votes1
answer643
viewsPopular C# datagridview with inheritance class
Good people, I have the following situation: public class TiposMateriais { public int tipoCodigo { get; set; } public string tipoDescricao { get; set; } } public class Materiais { public int…
-
0
votes2
answers710
viewsServer Too Busy
I constantly have this situation: Server Too Busy when I run my webforms application. What should I do to resolve this situation? I think it’s IIS Express, but I’ve been told it could be a database.…
-
0
votes0
answers392
viewsDownload a folder to your computer
In C# to download a file use the code: using System.Net; void Baixar(string url, string saida) { WebClient wc=new WebClient(); wc.DownloadFileAsync(new Uri(url), saida); } So far I haven’t found any…
-
0
votes1
answer165
viewsMy Repeater does not render in the browser
I created a Repeater and I can’t render it. When I inspect the object, it doesn’t appear. I took the code above it, called Analyze registration data and repeated after the Reset and can view, but…
-
0
votes1
answer97
viewsConcatenate aps.net expressions with literal text
I have that expression: <asp:Label Text='<%# Eval("Analista") %>' runat="server" /><br /> The result is Approved or Disapproved. I would like to add the following word: by: In…
-
0
votes0
answers48
viewsDatarepeater replacement
I always used Datarepeater to put my data and put buttons. Only in visual studio 2013 he disappeared. How do I use it without downloading Powerpack? Or if you have something like your ease? to do…
-
0
votes1
answer78
viewsSave fk right after pk is generated with Entity
I have a system and this system has some tables that are associative. As soon as I write the main table in the comic book, I need to make sure that that new generated PK is recorded in three other…
-
0
votes1
answer1459
viewsGet name of worksheets containing in an excel file with c#
I have a problem regarding getting the name of the spreadsheets that have to in an Excel file. I need to read a file that contains several spreadsheets, and would like to get the name of all and…
-
0
votes1
answer202
viewsHow to set a default page?
I downloaded a project, which when I’m going to run from this: The web server is configured not to list the contents of this directory. I’m new to this environment, what I have to set up? Note:…
-
0
votes3
answers613
viewsHow popular Dropdownlistfor with information from a foreign key?
I have these two classes and I need to popular a Dropdownlistfor with the information of the classes ModeloVeiculo, this Dropdownlistfor will be made in the create.cshtml of the class Veiculo, I…
-
0
votes1
answer704
viewsQuery Mysql in Visual Studio does not return all data
I have a problem in Visual Studio, where in my database access class, I have a query that makes a query in my Mysql database, and returns only the last result. Therefore, when I test this same query…
-
0
votes1
answer2993
viewsConvert C++ to C#
Well, I’m passing some codes I have, and I’m doubtful I can pass that code to c, and I’d like help from anyone who can help, in the following code below #include <dirent.h> #include…
-
0
votes0
answers210
viewsHow to save the state of a Treeview in ASP.NET / C#?
I have a treeview that is persisted in Database and, from the application, it is possible to add or remove items, both from TV and BD. Big problem is that I can’t find a simple way to save the…
-
0
votes1
answer50
viewsModify an Address with several Offset
Hi, I have this address Game.exe + 01438C2C and these offset 0x0 0x3C 0xA6C and would like to know how to modify the value in their Hex. Ex: 61 72 30 32 for 61 72 30 33 I was using…
c#asked 9 years, 10 months ago Eduardo Lima 1 -
0
votes2
answers1717
viewsHide/Display text fields in view
I have a table with dropdownlist and editorfor fields to fill in the user request. I need to add a new feature now which is: If the user selects a specific option in the dropdowlist 'Unit' two new…
-
0
votes2
answers528
viewsButton event with Asp.net
I create a boot in Asp.net, put onclick "testBotao", and tighten F7, but it does not load the event, only the pageLoader. How do I capture the event?
-
0
votes1
answer93
viewsConnection with 3g unstable locked in C#
I have a system, which uses a table in mysql to check if there is an update for it, It happens that at certain times, it is necessary that the modem is reconnected so that the system can do these…
-
0
votes1
answer171
viewsError converting Bigint to integer using lambda
In the database the guy is BigInt and in C# I’m trying to convert to int and he can convert, but when it comes to instruction lambda, makes a mistake. long codpro =…
-
0
votes0
answers57
viewsAdding a Webservice
How to add a Webservice reference where the properties of the Metadata have been disabled! Ex: Webservice server: http://192.135.025.22/authentication.svc But Visual Studio 2012 says it was not…
-
0
votes0
answers104
viewsRedirect loop problems when calling page
I made that if and is giving redirect loop. I removed the parameter false and continues. The page exists and etc... if (Session["DsTipoUsuario"].ToString() == "1") {…
-
0
votes1
answer393
viewsInjection of dependency with Ninject
I’m using Ninject on ASP.Net MVC and trying to implement, but I’m getting a bug: Error Activating Isessionfactory No matching bindings are available, and the type is not self-bindable. Activation…
-
0
votes2
answers2942
viewsHow do I get the Server time or current time of day and switch to the system via code?
I need to update an O.S system with the time of another micro, if this other micro would be a server. I would like to do this via code. Another method that would also help would be to take the right…
-
0
votes1
answer355
viewsdoubts when mapping nhibernate
I have the following scenario: public class ExemploDTO { public virtual int Id { get; set; } public virtual List<PessoaDTO> Cliente { get; set; } public virtual ServicoDTO Servico { get; set;…
-
0
votes1
answer615
viewsTake Model in View with values from the database
I have that class: public class MontaArvoreAcao { public int IDRuptura { get; set; } public DateTime DataRuptura { get; set; } public int IDMotivo { get; set; } public string Motivo { get; set; }…