Questions tagged as 'c#'

1
answer

View SQL at runtime

Is there any monitor that shows me the sql script at runtime? For example, during the debug, I would like to see how the script was mounted by the following code: var q = (from proc in Sessao.Query<Processo>()...
asked by 28.03.2016 / 14:53
1
answer

Error CS1526 & CS8032 [closed]

By the translation of the error says that I have to put a ")" at the end of the "type" but already  there is a ")" at the end of the "type" already tried to change to "[]" but it did not work I tried to put 2 ")" as I saw in other codes but also...
asked by 11.04.2016 / 23:27
4
answers

C # Textbox stop receiving after the comma

I need a textbox to stop receiving values after the comma as soon as I hit 2 houses. For simplicity, think that the text has a border after the comma, but none before it. Example: Enter the number 2.99. Therefore, whenever the user trie...
asked by 10.06.2016 / 17:33
2
answers

Validating date and time

As I do so that in the date field, not saved a date that has passed, for example the one of yesterday and in the hour field do not enter an invalid time, for example 27:00, only the Brazilian hours. Both fields are MaskedTextBox . Date...
asked by 03.07.2016 / 02:08
1
answer

ComboBoxes that share the same DataSource, change the selection together

I'm doing a production order project and I have 7 combobox picking up the values from the same table (which are those of raw materials). I am using this code in load of the form to load the combobox: cmbMP1.DataSource = bllprodutos.DtMa...
asked by 06.06.2016 / 18:17
1
answer

Correct way to make one-to-many relationship using C # and MongoDB

I have two entities, Sistema and Comentario where a system can have several comments: public class Sistema { public ObjectId Id { get; set; } [BsonElement("SistemaId")] public int SistemaId { get; s...
asked by 05.07.2016 / 14:40
1
answer

Html.EditorFor losing value when restarting the page

I'm starting my html.editorfor with "0.00" like this: @Html.EditorFor(model => model.Preco, new { htmlAttributes = new { @Value = "0,00"} }) But when the user receives some validation message (ModelState.IsValid = false), the editorfor l...
asked by 20.08.2016 / 14:12
1
answer

TempData Doubt C # with MVC

I know that TempData has its "life" held until it is used in View . However, if I do in two different controllers, the same identified TempData , I'm killing and over writing them. If the user is using 2 browser tabs, he ma...
asked by 25.11.2015 / 00:41
1
answer

TFS Api - Error in query with DateTime

I'm trying to make a query using the TFS API where I need to get all the WorkItems that have been edited from a certain date, however I get the following error:   An unhandled exception of type   'Microsoft.TeamFoundation.WorkItemTracking.Cli...
asked by 09.11.2015 / 17:32
1
answer

Set using array in C #

I have the following array: a d k m s j e r t c f p I put such array in an array as follows: char[,] matriz = new char[3,4]; matriz[0,0] = 'a'; matriz[0,1] = 'd'; matriz[0,2] = 'k'; matriz[0,3] = 'm'; matriz[1,0] = 's'...
asked by 18.09.2015 / 04:23