Questions tagged as 'c#'

2
answers

Remove HTML tags

In terms of efficiency and performance, which code is the best way to remove HTML tags in a string? Option 1: string ss = "<b><i>The tag is about to be removed</i></b>"; Regex regex = new Regex("\<[^\>...
asked by 23.11.2015 / 20:13
1
answer

Get Penultimate record of a table with Entity Framework

How do I get the penultimate record of a table with Entity Framework     
asked by 30.11.2015 / 17:37
1
answer

Add row in a dataTable

I need to add a row in a table in a given position. I have the following methods: public void criarTabela(DateTime dia) { tabela = new DataTable(); switch (dia.DayOfWeek) { //case...
asked by 30.11.2015 / 03:03
1
answer

How to make substring SelectListItem?

Follow the code: View: @model IEnumerable<Projeto.Models.Model> <table class="table table-striped"> <thead> <tr> <th> @Html.DisplayNameFor(model => model.Id)...
asked by 08.01.2017 / 19:32
1
answer

c # Nhibernate a different object with the same identifier value was already associated with the session

I'm at a time with this error and can not find a good solution. The recording of the objects works normally, however for changes it returns me this message:    Additional information: a different object with the same identifier   value was...
asked by 16.12.2016 / 18:07
2
answers

Popular data programmatically x manually

You can populate data from a component in .NET using Visual Studio's interface (Select DataSource ...). From the standpoint of popular performance data via code is faster than manualmentr?
asked by 24.03.2014 / 12:58
1
answer

Convert encoding CP850 to UTF8

I have a Paradox BD that returns me the following string after a query in an industry table that a given worker gets: Maintenance. Actually it should be Electrical Maintenance. I need to return this string to a browser. From my research, this...
asked by 28.03.2014 / 02:38
1
answer

C # Receiving Serialized Objects in a WebMethod

Good afternoon, I am passing a list of objects from JS to C #, to a WebMethod, as a function parameter, what kind of parameters should this be? I created a class to receive the data: public class serializeItens { //Dados de itens pub...
asked by 09.04.2014 / 20:04
1
answer

How to make a placeholder in a TextBox?

How can I simulate a placeholder using WPF? Something similar to the input of the HTML where you click on the field it adds the text and when you change it returns the text? Remembering it's in WPF, because in Windows forms I know onl...
asked by 28.03.2016 / 13:07
1
answer

Partial for separating events and methods

I have seen in a system a separation of the methods in a partial and the events in another in UserControl and Window as the example below: "Pessoa.xaml.cs" public partial class Pessoa: UserControl { //Construtor //...
asked by 20.04.2016 / 15:58