Questions tagged as 'c#'

1
answer

Error publishing project C # MVC, could not load file or assembly 'System.Web.Http.WebHost

I have a C # project in MVC, which running in Visual Studio 2013, works, but when I upload to the server it gives this error:    Could not load file or assembly 'System.Web.Http.WebHost, Version = 4.0.0.0, Culture = neutral, PublicKeyToken =...
asked by 10.12.2015 / 14:54
1
answer

How to call a form and hide the previous one in C #?

I'm in the middle of college project and I'm having a hard time. The system has a Form main and when I call the second Form the main is still visible. How do I hide the form master while the second is open? The code to...
asked by 27.12.2015 / 19:03
1
answer

Resize elements according to the size of the form

I have GroupBox within a Form that has the following pattern: Padrão de tela - Form: 1290;700 - GroupBox Principal: 1260;600 This Form is opened through MDI. I use a function to center this form according to the size o...
asked by 03.03.2016 / 16:48
1
answer

Error while reassembling a string. Size is out

I can not complete this list, as it is: foreach (var item in text) { string[] linha = item.Split('\n'); foreach (var i in linha) { string nova_string = i.Substring...
asked by 01.03.2016 / 18:24
2
answers

Convert Type to List

Good afternoon, I'm developing a project in C #, and I've got a bug right now which I can not resolve.    Can not implicitly convert type 'ITCore.FlowCredit.Business.Entities.ProductAmortizacaoCreditoDiasSearch' to 'System.Collections.Gene...
asked by 07.02.2017 / 18:57
2
answers

Pass List for ActionResult

Briefly: I have a screen with a table populated by the list below, where I select the line through checkbox , I need to pass that list to my actionResult . As I do not have a form on this screen I can not give the data to p...
asked by 03.02.2017 / 20:01
2
answers

Custom Viewbag, how to do it?

I need a custom 'Viewbag', which brings the name of the teacher and the id, related to the school login, for this I did: ViewBag.ProfessorID = new SelectList(from u in db.Pessoas.OfType<Professor>() join v in db.EscolaProfessores on u.Pe...
asked by 31.01.2017 / 19:54
3
answers

Interact / Search Button for your Tag using WPF

I have a screen with 25 buttons and would like to interact with the buttons through the code. For example, a number is generated using the Random function: Random rdn = new Random(); numero = rdn.Next(0,25); Let's say the result w...
asked by 15.10.2015 / 23:25
1
answer

C # Windows Form - Questions about Session

I need to save an information by the time the user is logged in to my software, I searched and saw that for web pages made with ASP.NET there is the object SESSION , but for Windows Form? The information I need and the user name, I have...
asked by 21.07.2016 / 15:15
1
answer

How to get the text of the line where the cursor is positioned?

I have a textbox, and I need to get the contents of the line where the cursor is positioned. For example, I'm in the third line of the textbox (cursor positioned on it), I'd like to get the contents of that line. Thanks in advance ...     
asked by 18.07.2016 / 02:05