Questions tagged as 'c#'

2
answers

How to associate items from a List of Strings to the code name of a label in C #?

My goal is to make a gallows game. Basically my problem is this: I have a word divided into substrings for each letter of the word, all stored in a vector. For example: string[] letras = new string[numletras]; for (int i = 0; i < numle...
asked by 16.01.2018 / 16:45
1
answer

Using SQL Query with Asp MVC5

How do I execute a SQL query with ASP MVC5 + Entity? To create the MVC I used the entity's own option (I created the model, context) and already generated the controller and the views Follow the controller code: using System; usi...
asked by 15.01.2018 / 18:50
1
answer

Identify two modifier keys pressed

How to identify which two keys are pressed inside a click event of a button? Example: Button btn = new Button(); btn.Click += Btn_Click; private void Btn_Click(object sender, EventArgs e) { // Assim consigo identificar que uma tecla está...
asked by 05.02.2018 / 17:19
1
answer

Windows Standard Actions Form [Minimize - Maximize - Close]

I'm using visual studio - Windows Forms, and by default the form has the "Minimize" form control buttons from "Maximize" > and another to Close the form that is an "X" I need to manipulate the actions within them, more specifically I wa...
asked by 17.10.2017 / 21:31
1
answer

How can I check if all textbox is empty? [closed]

Code: if (string.IsNullOrWhiteSpace(txtNumero.Text) && string.IsNullOrWhiteSpace(txtTitle.Text)) { MessageBox.Show("Preencha todas as informações"); } I tried to do with & and it does not work, how can I do it? I want to che...
asked by 26.09.2017 / 15:01
2
answers

ASP.NET Core Attribute routing

I'm migrating a project to ASP.NET Core 2.0, but I'm not able to use the following routes. Error message. An unhandled exception occurred while processing the request. AmbiguousActionException: Multiple actions matched. The following...
asked by 27.09.2017 / 03:01
2
answers

Import Excel C # OleDB

Friends, I have an exception when importing Excel; [error] The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine [Code] string conStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=...
asked by 08.11.2017 / 15:01
1
answer

DateTime UTC Daylight Savings Time NF-e

How can I change the time zone of a variable of type DateTime ? The idea is to do a routine where the user does not need to change the computer time to perform NF-e transmissions, but it is dynamic without having to punch the current ti...
asked by 08.11.2017 / 14:53
1
answer

Convert "date and time" to "date" in C #

I need to convert "date and time" to "date" in C #, keeping DateTime format (without converting to string). In the code, I'm converting an object to datetime, but I need to remove the time for it as well to display it in a DataGridTextColu...
asked by 07.11.2017 / 18:04
3
answers

Event onclik button in dynamic html table StringBuilder

Good afternoon personal forum, I'm trying to add a button in a dynamic html table to redirect to another page passing parameter by url. But I'm not getting via javascript. I am using ASP.NET C # WebForms. I have the following function to write v...
asked by 20.09.2017 / 20:49