Questions tagged as '.net'

2
answers

Update data using LINQ

I've read that LINQ should be used for queries, but in the context below, the best way I found to update was using let . var produtos = from o in orcItens join p in Produtos on o.Id equals p.Id let x = p.Estoque -= o.Quant...
asked by 02.01.2016 / 02:18
2
answers

Photo saved in Directory does not appear in Solution Explorer

After much pain, you can save the photo in the directory and not the bank. But she does not appear in my folder in my Solution Explorer, but when I open the photo through the windows explore it appears. Because of this, the photo is not displ...
asked by 08.06.2015 / 18:26
1
answer

Find data from related tables

I know that to return the values of a directly related entity in the database is done with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how do I get the data back from another table related to the "Type" tab...
asked by 26.05.2015 / 14:06
1
answer

High performance .Net website

I'm going to start building a website to buy tickets and the forecast for main page access is 8000 users per minute. We will use C # .Net and MVC. The database, project standard, ORM, and frameworks are open and can be chosen. So far I...
asked by 30.09.2015 / 04:59
1
answer

ProgressBar within a Task

How can I change the values of an interface control within a separate task from the main thread? Example: private void button1_Click(object sender, EventArgs e) { Task task = new Task(Processar); task.Start(); } pub...
asked by 29.04.2015 / 04:24
2
answers

Handle 404 error without using try / catch

I have the following code snippet that does an HTTP request , but sometimes the URL does not work, then an exception will be thrown by the framework . > HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = WebRequ...
asked by 30.08.2016 / 14:06
2
answers

View control in Partial View conditionally

I need a Partial View control to be displayed according to a condition. For some views a button would appear for others not and this would be set via a parameter in the Partial View call. After searching I saw that I can use ViewDataD...
asked by 09.04.2015 / 04:04
1
answer

VS 2012 bundles to use or not to use, that's the question!

I'm starting in VS 2012 and between changes appeared bundles . I have some doubts: 1 - Is it worth using this approach? Why? 2 - The bundles should even be within the ScriptManager tag 3 - Can I continue referenci...
asked by 23.12.2014 / 14:06
2
answers

Circular reference between two projects

I'm working with two projects in a solution . To use a ProjectA form in ProjectB I referenced the ProjectA in ProjectB , from this I have access to the ProjectA forms. But what if I want to have access to the ProjectB forms in...
asked by 13.04.2016 / 15:41
2
answers

Search week number of the year through a date in C #

I'm writing a function that gets a string with a date (format dd/mm/aaaa ) and it should return a date in the same format 4 weeks later. Example: Entrada: 07/04/2016 saída: 05/05/2016 I read about it and thought of the following l...
asked by 07.04.2016 / 20:13