Questions tagged as 'c#'

1
answer

Block reading, opening and editing file

How to block a user's opening, reading, and editing of a file during the time the application is running? An application has a relatively long data collection period. This application reads data in real time. The data read is written to the f...
asked by 19.07.2017 / 05:00
1
answer

Instantiate a class from its name in string

I have a select where I have some options Test1 Test2 Test3 I have a model for each option public class Teste1() { //atributos e métodos } I would like, in a certain part of my system, to receive this string ex: "Test1" and c...
asked by 30.10.2017 / 13:24
1
answer

Show fields of an entity in a different View

I have a Academic entity that has a Teacher , I want the Academic Detail Professor who belongs to this Academician . The code I'm already using is this: Teacher model: public class Professor : RepositorioBase<Professor> {...
asked by 08.11.2017 / 17:27
1
answer

Attempting to pass Controller values to Global.asax.cs to fill in the sessions

When I try to pass some value from my controller to Global.asax the values received in the global are always null. Controller: public class LoginController : Controller { DataContext db = new DataContext(); public ActionRes...
asked by 09.12.2016 / 13:46
1
answer

progressbar reaches maximum value but visually does not fill in C #

I'm working with a C # software, in which after a login screen, a splashscreen appears with a progressbar that when it reaches its maximum value (100) , it calls the main form of the program. The problem is that progress...
asked by 07.11.2016 / 18:32
2
answers

Clear button radio button

Good morning I would like to know how do I clear what was clicked on the radiobutton button, because in the textBox I use the name.Clear (); I would like to know how I can do it on the radio button Thank you.     
asked by 16.11.2016 / 14:24
2
answers

Using LINQ to query a collection

about min: I come from JAVA and recently I'm learning C #, but I have a question about using LINQ. Many tutorials speak of the wonder that is LINQ but I can not understand its usefulness so far. Look at this code below: class Program {...
asked by 12.12.2016 / 20:14
1
answer

How to use dependency injection outside a Controller with ninject

I have following code: public class ContaController : ApiController { private readonly IAppServiceUsuario _app; public ContaController(IAppServiceUsuario _app) { this._app = _app; } } How to inject dependency with...
asked by 20.12.2016 / 16:42
1
answer

Decimal values being rounded in SQLIte

After migrating my Access database to SQLite 3 in a Windows Forms application, I have been having difficulties with values of type Decimal. If you run a simple select: SELECT * FROM Item WHERE id = 1; The decimal values in the preco_item co...
asked by 18.12.2016 / 19:39
1
answer

Passing a variable from javascript to session

I would like to know how do I submit a value that I have in javascript for an @session. in the case it would look something like this: I have a variable:    var id = $ (Person) .val (); This ID wanted to use in a session variable, but...
asked by 25.11.2016 / 04:42