Questions tagged as 'c#'

1
answer

How to work with DataGridViewCheckBoxColumn in C #?

I'm having some difficulties working with the data grid view selection field, I tried to do this: public void Atualizar() { Stock obj = new Stock(); for (int A = 0; A < dgv_Entrada.RowCount; A++) { int ID_Cod = Co...
asked by 19.09.2017 / 12:03
1
answer

Disable action on the mouse moves C #

I have a problem in my code, I have some actions on mouse moves in C # and would like to disable them. Whenever I drag the mouse to the listbox of my form, it already does the action, I would like to leave it in the mouse click, but I am in diff...
asked by 25.09.2017 / 16:27
1
answer

Error editing registry more than once with EntityFramework C #

When editing a record and saving for the first time the entityframework performs the update successfully, however when I click again to edit and save the registry I encounter the following error:    Error saving record: Attaching an entity of...
asked by 25.09.2017 / 22:33
1
answer

Change GridView

Ineedtochangethesetwofields(category_idanddesc_category)Form: private void Mostrar() { this.datalista.DataSource = NCategoria.Mostrar(); } Business layer //Método Mostrar public static DataTable Mostrar() { return n...
asked by 26.09.2017 / 02:20
1
answer

Delete a foreach and replace the result in a lambda expression in a method

The thing is very simple indeed. I have a method that takes a name inside a database and compares with the parameter passed in the method and being is equal, return it in the method, otherwise return a string.Empty . It turns out, I'm havi...
asked by 20.07.2017 / 14:52
1
answer

C # is not finding / recognizing my List

I have List made with the following code: List<frase> frases = new List<frase>(); According to documentation of System.Collections.Generic my code is right. But for some reason C # is not finding List , wha...
asked by 07.07.2017 / 02:37
1
answer

Error using GROUP via LINQ

I'm trying to perform the query below: var query = from s in db.Crm_Analise where s.cliente_CRM == cod_cli group s by s.TAG into g select new...
asked by 14.07.2017 / 18:20
2
answers

Is there a surefire way to not wait for a process?

Is there a secure way to not wait for a process in .NET? async Task DoFoo() { // ... GravarLog(); // ... } void GravarLog() { // ... } In the code above, my whole process will wait for the GravarLog() method to finis...
asked by 28.07.2017 / 22:32
1
answer

Load excel data on the screen [closed]

I have a problem loading data from a worksheet on the table. The system is done in C # MVC5 with razor and entity framework, I need the user to choose an already filled excel file and with the data of that file I have to present it in a html...
asked by 28.07.2017 / 21:25
1
answer

What is the best way to save multiple image links in a database?

List<String> _lista = new List<String>(); [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(Veiculo veiculo, HttpPostedFileBase[] file) { for (int i = 0; i < file.Length; i++)...
asked by 05.09.2017 / 18:10