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
votes0
answers97
viewsRecords in Icollection<> navigation property are not being recorded
I’m trying to make an inclusion of items in a list property but I’m not able to include the records in the database. First I have the following class models: public class Frota { public Frota() {…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 11 months ago JamesTK 901 -
0
votes0
answers194
viewsProvider: SQL Network Interfaces, error: 26 - Error Locating Server/Specified Instance
Hello friends, I am making a web application with Entityframework using Codefirst and every time I try to access, add or edit data has given the error below. Can anyone help me? I work with…
-
0
votes2
answers809
viewsProblems saving XML file with special character in the database (ç, ã, etc)
My problem is this: I am issuing an electronic correction letter in C# and at the time of saving the XML of the event returned by SEFAZ, as much as all the characters in the file are normal, when…
-
0
votes1
answer1802
viewsC# MVC 4 - Action gives Error 404
I am a beginner in C# MVC 4 and have set up a site for learning purposes. On the contact page of the site there is a form that sends emails automatically. When I run it locally direct from Visual…
-
0
votes0
answers256
viewsHow to access a linked table in access via C#
I wonder if there is any way to make a query in an Access file, but not in a normal table created in Access but a linked file (in this example a txt). The error you made when I selected was as…
-
0
votes1
answer400
viewsImplement Oauth server
I would like to know how to implement an authentication server using Oauth. If anyone has a clue how to do that, I’d appreciate it.
-
0
votes3
answers119
viewscreate java script functions after rendering all partial views
I have an aspnet MVC code with a main view that can call 3 view partials depending on where the user clicks. one of these partial view was part of the main view and had a jquery sortable ui plug,…
-
0
votes2
answers146
viewsContext trying to delete the same record twice
I’m having a problem, actually it must be the same lack of knowledge, at the time of deleting a record using Entity Framework 6. When I try to delete a record that cannot be deleted because it has…
-
0
votes1
answer389
viewsProblem creating a database diagram in Visual C# 2010 Express
Even creating a table called "People" previously, when creating a new database diagram in Visual C# 2010 Express, there is no table option for me to work on, not even the "People" table I created…
-
0
votes2
answers750
viewsRead a BLOB corresponding to an image
The following code uses the Mysqldatareader to obtain a database-specific record: string cmd = string.Format("Select * from socios.socio WHERE idSocio={0}", chave); MySqlCommand comandoMySQL = new…
-
0
votes3
answers2316
viewsC# Make Enter key jump to either textbox or combobox field
How can I do in a function, that when the person der enter , he jumps to the bottom field , which can be both a combobox and a textbox? I currently have this function , but it jumps to the last…
-
0
votes1
answer723
viewsFind the dataRow index
I’m walking a DataTable with a foreach using a variable of type DataRow, but I need to recover the content of DataRow that I’m walking through. foreach(DataRow row in DataTable.Rows) { string…
-
0
votes1
answer178
viewsCode Conventions in C#
I have some experience with Java and C. Recently, I picked up a project in C#. I wonder if there is a style guide from Microsoft or some other entity to learn what the C programming style looks…
-
0
votes2
answers100
viewsDropdown field increment
Well, I have the following problem. I have to use a Javascript or Jquery function to add new fields to fill and save in the database. In these fields I have to use a Dropdown, but I don’t know how…
-
0
votes0
answers43
viewsWebservice with generic contract interface
I’m trying to host a Web Service on a Windows service. And when setting up serviceModel in the App.config I’m getting the following error warning from the editor: Webservice is a project of the kind…
-
0
votes1
answer106
viewsHow to make it redirect
I made an application in C#, in addition to performing the basic functions, I want it to be possible to run with scripts in batches, but the problem is that I run Console.WriteLine and he doesn’t…
-
0
votes1
answer75
viewsAdding a Materialdesigninxamltoolkit controller with C# in XAML
I’m using Materialdesigninxamltoolkit to design my program in WPF, I’m new in WPF and wanted to know how I can add the Card controller by C#, as I do with Button or any other native WPF controller…
-
0
votes1
answer249
viewsHow to use an iOS simulator in a Windows 10 environment for a Xamarin.Forms iOS project
What I need to install to publish a Xamarin.Forms.iOS project in an iOS simulator? I’m using a machine with: Windows 10 Visual Studio 2015 Whenever I try to run some Xamarin.Forms.iOS project a…
-
0
votes0
answers33
viewsReceipt of HEX Via TCP
I need to convert a string that has been converted to HEX and sent via TCP to string. I tried the 2 ways below and only get string unscathed : public async void HandleConnections(TcpClient client) {…
-
0
votes2
answers6462
viewsCreate excel file with c#
I have a problem: I have to generate a class in C# to create an Excel file, but I’m not getting it. Someone can help me? The idea is to generate an Excel file with a menu and a line with values.…
-
0
votes1
answer251
viewsCreate a get/set for the Cpf string, which verifies that it has 11 digits, being numbers?
private static string cpf; public bool CPF = cpf.Length == 11 && cpf.All(char.IsDigit); public string Cpf { get { return cpf; } set { if(CPF) cpf = value; } } When I try to create property…
c#asked 7 years, 8 months ago Henrique Macedo 1 -
0
votes1
answer43
viewsBring only certain amounts of MVC bank information
I need to bring only 6 records from the database to show in the View, instead of bringing only 6 records, bringing all. The code is as follows:: public PartialViewResult Cursos() { ViewBag.Cursos =…
-
0
votes1
answer57
viewsJavascript button error on IE9
I have a browser problem only in IE9, which occurs at the time I load an attachment and when I click the include attachment button (POST) as image below: function uploadResponse(frameId) { $.ajax({…
-
0
votes1
answer126
viewsDynamic listbox with value range
My problem is that I can treat my listbox where I am doing a "value range" in my system. I need it not to let codebehind add a value that is contained in the value range.. Ex: 0-10 has been added,…
-
0
votes1
answer352
viewsError trying to recreate a table with code first(Migration)
I’m following Eduardo Pires' tutorial on DDD + Asp.Net MVC 5 + Ioc and so on. Well, in the first attempt to create the bank and the client table, it was a gem. It turns out, Eduardo made some…
-
0
votes0
answers33
viewsDisable map movement with mouse
I have a page with a map mapLink, I would like to disable the option to move (drag) the map with the mouse. UPDATE I contacted the support of mapLink, they passed me the function disableDragging(),…
-
0
votes1
answer476
viewsFramework c# with windows Form Application
I’m looking to develop a C# ERP with windows Form App, I wonder if there is any framework for this part. Because I searched and found Entity, but I couldn’t find if I can use it in desktop…
-
0
votes1
answer580
viewsAjax sending template to controller
I wonder if it is possible to pass a "Model" object via ajax to my controller. $.ajax({ type: "POST", url: "@Url.Action("CadastrarSementesVariedades", "SementesLevantamentoVariedades")", data:…
-
0
votes2
answers1129
viewsPermission Control in c# and Windows Form
I would like to create in C# with Windows Forms ( basically equal Windows folder permission), access levels for users, but not as level 1, 2 and 3, but for example: User A can only view a customer…
-
0
votes3
answers123
viewsContains within a list
I have a list of Assets that contain a list of Accessories I would like to filter all Assets that accessories(ID_ACESSORIOS) are within a list of int. Follows the code; //Lista com todos os…
-
0
votes0
answers80
viewsShow query output within a C# Website textbox
I have a little doubt about showing a query. On my website I want to show the result of a query. For example: Number of employees: [and here appear the total] I’ve got the comic book connections…
-
0
votes2
answers277
viewsTime execution in time
As I do in the universal app win 10 to perform a code execution of 10 in 10 sec. In the form would use adding a team. Please help me.
-
0
votes2
answers103
viewsDo you doubt the mysql database query?
How to create a code to check if there is a new record in the database? EX: id = 2 has been entered, I need to create a code that will generate a notification every time a new id appears.…
-
0
votes2
answers479
viewslast Mysql record
How to know the last ID record in the table and play the number in a textblock? using (_connection = new MySqlConnection("Database=test;Data Source=localhost;User…
-
0
votes0
answers81
viewsWhen and why should a static method be used?
I always had this question about the POO, I see many codes with Static methods and now starting in C# is no different. Being direct, when you should use this type of method, why use it and its main…
-
0
votes1
answer49
viewsCheck value textbox x mysql (universal app win 10)
I have a textbox where I save a value. I wonder if this value is the same as the last id in my mysql database table. How do I do this?
-
0
votes2
answers71
viewsData query file Settings
I have some projects in my Solution and in one of them I will have the Settings configured with some parameters. My question is: If I reference this project in others, I can read these parameters in…
-
0
votes0
answers60
viewsDownload and open compressed files
Guys I have the following code on an aspx page that compresses files and then downloads them... protected void Page_Load(object sender, EventArgs e) { try { JuntarArquivosAprovados(startPath);…
-
0
votes2
answers339
viewsCustomize an item within css for a particular view
I have this view on MVC View @model XXX @{ } <link href="/eTeste/Content/AbaDetailsODM.css" rel="stylesheet" type="text/css" /> <div id="consoleAbaDetalhes"></div> <div…
-
0
votes1
answer97
viewsDuplicate data C#
I made a basic registration system in C#. I created a List<T> to keep my data in memory and then display it. But when I register the second person, this data "clones" the other data. When I…
-
0
votes1
answer43
viewsHandle one item at a time in the API
I have a API that makes the POST of Item in the database, but before doing the POST she makes a GET to obtain a code for the Item that will be saved. NOTE: this code cannot be repeated in the…
-
0
votes1
answer193
viewsArduino + C# + RFID?
I can get the id of tag with this snippet of code and play in a Textbox, but, it would take information from which reader RFID she was read? serialPort1.Open(); string entrada =…
-
0
votes0
answers58
viewsProblems with accentuation Asp.Net c#
I’m wearing a foreach in my View, but I’m having problems with accentuation, note the code: @foreach (Area areas in Model.ListAreas) { @:{ id:@areas.Cod_Area, text: '@areas.Desc_Area'}, } Note: Meta…
-
0
votes1
answer86
viewsMake variable wait function to be generated
I have the following code: XmlParaApi = xml; that passes a string variable (xml) to a string global variable (Xmlparaapi). Until then all this code is in an Api, the Gora my problem is with the code…
-
0
votes1
answer855
viewsLocation and maps
Hello, I will work on an application that I will have to work with localization and maps, basically the user will inform an address and will appear to him nearby locations, so I wanted to know +-…
-
0
votes0
answers76
viewsHow to restore backup done with SMO?
I need to back up and restore using SMO. The backup I can do, now when I select it in the combobox by typing the server and database name of the error. Follow the code of the Restore button: private…
-
0
votes0
answers50
viewsWhat do the terms Generic, Non-generic, Cast, Boxing and Unboxing mean?
Can anyone explain these terms so commonly seen in C#?
c#asked 7 years, 8 months ago Eduardo Moscatelli 661 -
0
votes2
answers234
viewsWebforms Upload multiple files
I have an app WebForms that needs to receive multiple files that will be associated with a specific type of my system. Ex: Type: [Driver’s license] | Filing cabinet: img001.png Type: [Proof of…
-
0
votes1
answer769
viewsDatabase connection in Windows Form?
How to make/call the database connection in Windows Form? Knowing that the database configuration is in the app.config
-
0
votes2
answers727
viewsHow to rescue the App.config connection string from another project?
I have these connection strings on App.config of another project: <connectionStrings> <add name="ConexaoTeste1"…