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
answer896
viewsHow to convert address to coordinates on Windows Phone?
I need to create a route on the Windows Phone map. The starting place is the location of the phone, which I capture by the classes Geolocator and Geoposition. The place of arrival is an already…
-
1
votes1
answer141
viewsResource with database
Well I have the following environment: Table: Livro id titulo tituloEN descricao descricaoEN Controller: [LivroController] public ActionResult Index() { var livros = bdLivro.ListarTodos(); return…
-
1
votes1
answer491
viewsInclude a search button inside a gridview c#cell
I have the following problem: I have a gridView on a Windows form system that I am developing with c#. This grid will serve for the user to include items of a quote. In the product cell, where the…
-
1
votes1
answer153
viewsAccess denied when using MS Syncframework
I’m trying to implement a system where I need to have a local database (SQL Compact) and a cloud database (MSSQL) that can be synchronized. The shape I found that I’m following is the one specified…
-
1
votes1
answer999
viewsDbcontext: use other connection strings - Entityframework
I have a file web.config with 4 connection strings. How can I put these connection strings in the class DbContext? public DataContext():base("ConnectionString") // Essa é minha conexão padrão { }…
-
1
votes1
answer2118
viewsHow to fix the error: Schema specified is not Valid
I modified the BD of my project and performed the update of my edmx file, but now when I try to compile the error is appearing: No Entity Framework Provider found for the ADO.NET Provider with…
-
1
votes2
answers1193
viewsMore than one *Layout* in the app
How do I instantiate a new screen, I have the Main.axml And I wish that when I hit the button I’d call my own Result.axml. I wonder how I do it in Xamarin in C#. And if I need 2 Activities’s one for…
-
1
votes1
answer2330
viewsDelete a folder even if it is with files
What code should I use to delete a folder where it contains files within it? This code I used only erases an empty folder. void ApagarPasta(string nameOf, bool subPastas){ Directory.Delete(nameOf,…
-
1
votes1
answer55
viewsHow to pass a string value to a type in the Entity
In my Entity mapping, the fields that are FK got like this: public virtual T_Acao T_Acao { get; set; } public virtual ICollection<T_OsParceiro> T_OsParceiro { get; set; } public virtual…
-
1
votes1
answer129
viewsIn the table Insert is inserting everything, until what I do not want
When I give a savechanges(), records to all tables and would like just one. How do I do? Tables Acao and ProximaAcao also inserts record. public T_TarefaParceiro geraIdParceiro() { WEBEntities db =…
-
1
votes1
answer570
viewsLog Navigation C#
I have Two buttons: Next and Previous in a Windows Forms application in C#, I am using an SQL statement: SELECT * FROM aluno LIMIT 1; for MYSQL. This statement takes the first record. Now comes the…
-
1
votes1
answer112
viewsAjaxtoolkit and Htmleditorfieldextender. Content Demo
I’m using the HtmlEditorExtender of Ajaxtoolkit and in it I enabled the option to insert an image to the body of the text. <asp:TextBox ID="txtDescricao" runat="server" TextMode="MultiLine"…
-
1
votes1
answer402
viewsHow do I update my WPF application after it is installed?
I’ve found several programs that create an installer for my application, but I’m worried when I need to make system updates, I need it to be something automatic, when the user logs in, the system…
-
1
votes2
answers995
viewsConvert text to number in C# to write to DB
I’m using this conversion to get the string from txtvalor.text and turn it into such a value: 1.500,80 curso.Valor = double.Parse(txtValor.Text); Example I type 1,500.80. And I would like you to…
-
1
votes5
answers13026
viewsCoin style in a Textbox in Winforms
I need to put the text R$ in a textbox so that it has the following format: R$: 1,200.58 I am trying in the following ways without success: textbox1.Text =…
-
1
votes2
answers1937
viewsHow to render html by passing as a controller string to the view?
I have the following view: public ActionResult RelatorioEquipe() { ViewRelatorioEquipeDTO dto = new ViewRelatorioEquipeDTO(); dto.LstUnidadeGerencial = negocio.Relatorio.ObterLstUg();…
-
1
votes1
answer424
viewsConnection via PHP to an SQL Server 2012 database
My problem has some variants: I have a website built on joomla, which is hosted on a linux server. The administrator where I have hosted my website has already informed me that it will not install…
-
1
votes2
answers1122
viewsSqldataadapter Query with Parameters
I’m having difficulties in returning a query in the database using SqlDataAdapter with parameters. Well, I have a layered application in my View when I first access a GridView with a query (this…
-
1
votes1
answer689
viewsFind files on Xamarin Android
I am putting an xml file inside the project but it is not being located by my XmlTextReader where in the project I should put this file and how to find it in the emulator folder? I’m using Xamarin…
-
1
votes1
answer2405
viewsLogin failure for user "NT IUSR AUTHORITY"
I have a Webservice application running on IIS, but how much I try to consume from this error: System.Exception: Login failed for user 'IUSR NT AUTHORITY' I tried to add this user in the database,…
-
1
votes1
answer120
viewsRun Trial with Codefirst
I am trying to run a trial on ASP.NET MVC with Codefirst. I saw some examples on the internet but they are not working, someone can help me? Follow the code I’m using, the Procedure just copies some…
-
1
votes1
answer1783
viewsFormat cell in Datagrid at runtime C#
I am creating a Datagridview automatically with a time column and am using the time format 00:00, as follows below. dgvhorario.ColumnCount = 1; dgvhorario.Columns[0].Name = "Horário";…
-
1
votes1
answer119
viewsC# Manualresetevent
What good is the code below the Manualresetevent connectDone? If I use it, when running the main thread hangs, as I am using this code within the Unity3d(game engine) it hangs the entire process and…
-
1
votes2
answers384
viewsCreate menu type, but with (+) sign (Treeview)
Use Bootstrap 3.1, Entity 6.1, Visual Studio 2013, MVC5, Jquery and etc... Well, I need to make a query, so that when the screen is loaded, it can carry some information, such as medicine…
-
1
votes1
answer945
viewsDoubt about Insert in bank with foreign key using Inline
I have a question, how to insert data in a Mysql table, using English, I have the tables below: I am using the method below to insert: public void inserirCarteira(float cpf, string codigo, double…
-
1
votes1
answer326
viewsError changing C# Asp.net application model
I needed to change an application made some time ago in C# Asp.net. I added the column in the database I needed and when I add the corresponding field to the model, when running the application it…
-
1
votes2
answers67
viewsConsider null and empty strings as equivalent to each other
I want to compare strings that come from two different sources. If they’re different, I’ll do something. Something like this: if (foo != bar) { noop(); } However, in my specific case, I am…
c#asked 10 years, 3 months ago Oralista de Sistemas 23,115 -
1
votes1
answer289
viewsChecklistbox when dynamically loaded does not mount the check’s
When it was manual, the check’s(the check boxes) were all ok. As I now mounted via jquery and controller, no longer assembles the check’s, is like a listbox without being able to make selection. See…
-
1
votes1
answer236
viewsCompare Crystal report text
Good afternoon. I would like to know how to assemble a formula in the Crystal report so that you see, if in the text the word "QTDA", if it exists it signals the whole cell with the color red, if it…
c#asked 10 years, 1 month ago rafaelbertoco 15 -
1
votes1
answer2006
viewsHow do I change the border color of a Textbox in a Windows Phone 8.1 app?
In a certain function of the .cs in C# need to change the color of the edge of a TextBox. In my xaml have the TextBox <TextBox Name="txtResult" Text="resultado"/> And in the cs have the…
-
1
votes1
answer138
viewsRelational Combobox C# BD Access
I am building a C# application with Access database. I have two tables one of CIDADE and another of ESTADOS. What I need is when I am selected on combobox1 a state, the combobox2 load only cities…
-
1
votes4
answers2214
viewsBring a Max(Date) with LINQ
I have this Linq: var resultado = ( from pdv in db.T_PDV from tarefa in db.T_TarefaParceiro.Where(trf => trf.CNPJ == pdv.CNPJ).DefaultIfEmpty() from parceiro in db.T_OsParceiro.Where(prf =>…
-
1
votes2
answers888
viewsError including sum of values in the footer of a gridview
I’m trying to include in the footnote of a gridview the sum of two columns, but I’m having difficulty creating the method that performs this function. I’ve already put the property ShowFooter as…
-
1
votes0
answers120
viewsSearch button through Content and filter in search
I would like to implement a search field, and it filter the buttons and show only the filtered ones, in my case my buttons are inside a UniformGrid. This search function is similar to Windos 8…
-
1
votes2
answers104
viewsWhen concatenating into LINQ returns error
I did this LINQ. In the concatenation between DDD and phone number, which I call phone 1 is giving dick. var agendamento = ( from pdv in db.T_PDV from tarefa in db.T_TarefaParceiro.Where(trf =>…
-
1
votes1
answer578
viewsExpired web page when I return to the page by the browser button. Previous page c/ postback
In my current application, I have a content list page, which has a small form above to perform "filters" in Gridview below so yes select an item and go to the next page edit the same. What happens…
-
1
votes2
answers7019
viewsPass parameters through jquery to controller
I have a method in the controller(void) that receives some parameters(3). I am unable to pass to the method. The other times I did, passing to an object there, I have succeeded, with method…
-
1
votes1
answer934
viewsDisregard the header of a . csv file when importing into the database
I need to read a file . csv disregard the header when importing to the database as is possible ? I’m using the following code: linhaArquivo = arquivo.ReadLine(); campos = linhaArquivo.Split(new…
-
1
votes1
answer164
viewsSql Timeout with Webmatrix.Data.Database
Using the Webmatrix.Data.Database namespace, I am having problems executing a query that returns a lot of data, resulting in a Timeout. How can I increase the timeout of this query? Code example:…
-
1
votes1
answer594
viewsReturn more than one data list in the view
In my Return View(), is there a way for me to return two or more lists? These lists are the result of a.
-
1
votes2
answers1176
viewsWhy can’t I read a string on the console?
I’m trying to read a string typed into the console, which is halfway through the code, but what happens is it goes right through and displays the final information. using System; namespace Viernes {…
-
1
votes2
answers324
viewsGeneric repository with SQL
Seeing this question: Here I wondered if it is possible/right to use a scheme like this in a project in which I do not use any framework for connection to a database. I would like an example of the…
-
1
votes1
answer975
viewsTaking the content of a JS variable in an Asp.net C#
I have a Function that takes the values of my inputs, and I want to take the values of the variable for my method to perform the Insert. Does anyone have any tips on how to do this? function…
-
1
votes1
answer437
viewsProblem to create database using Entityframework with configuration by Dbconfiguration
I’m studying the Entityframework, writing two contexts to understand how to handle it when my domain contains many classes of entity. Which would then be represented by many Dbset s in context,…
-
1
votes2
answers83
viewsCreation of a mailClient
I’m on a project that I need to develop an Email Client, however I’m somewhat lost on that, so. I need to use the IMAP protocol (I studied its RFC in depth) and the C#language, but I can also use…
-
1
votes3
answers1945
viewsGridview Templatefield
I need to change a specific Cell in GridView, but when I try to do it this way in RowDataBound: TextBox x = ((TextBox)e.Row.Cells[i].FindControl("ctl" + tx.PadLeft(2,'0'))) x.Enable = False; or in…
-
1
votes1
answer46
viewsMultiple Resources Files in . NET
It is possible to have 2 Resources files in visual studio with the same Resources name, one of which is intended for test environments and another for production environments?
-
1
votes1
answer112
viewsAjaxbeginform replace does not work
I’m using a Ajax.BeginForm to update a specific div on the page. When performing Submit and executing the action, instead of updating this DIV, the page is updated with the partial view returned…
-
1
votes1
answer4456
viewsComponent to select files or directories
What is the name of that component in Visual Studio / C# that selects the directory and takes the file path?
-
1
votes2
answers2679
viewsFill Dataset with Datatable
In C#, how can I declare and fill a Dataset with a Datatable? My idea is to pass the data resulting from a query in the Database to the Dataset, then fill a Report with this Dataset. It is possible?…