Questions tagged as 'c#'

2
answers

Join two items from an IList in a single item by the Id

In my class it has: Id Venda Devolucao I have IList of this class, and in this IList has [0] classe Id = 100, Venda = 230.00, Devolucao = 0; [1] classe Id = 100, Venda = 0, Devolucao = 50.00; [2] classe Id = 101, Venda = 5...
asked by 08.06.2016 / 22:32
1
answer

Resize image in C #

I would like to know how to resize images in C #. I will receive images in both JPG, JPEG, GIF and PNG. usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem....
asked by 25.08.2018 / 16:24
2
answers

Error: Invalid thread operation

I'm trying to open the Webcam, however every time I try to execute the iniciarwebcam() method it returns me the error:    An exception of type "System.InvalidOperationException" occurred in   System.Windows.Forms.dll, but it has not be...
asked by 23.08.2018 / 19:10
1
answer

I would like to assign yesterday's day as Start Date every time my program was started in a dateTimePicker

I can assign value to it just do not know how to assign a yesterday private void Form1_Load(object sender, EventArgs e) { dateTimePicker1.Value = DateTime.Today; }
asked by 24.08.2018 / 16:18
1
answer

I am trying to do a rollback of my querys only that gives me an error in ExecuteScalar

The code works perfectly without btw rollback. SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString); con.Open(); SqlTransaction tran = con.BeginTransaction(); try { //Adicionar Tit...
asked by 20.08.2018 / 13:49
1
answer

Database CodeFirst Entity Framework, 1-0..1, 1-N

I have 3 tables and need to relate them via code (Code First) Iwouldliketoknowhowtodothis.Ialreadyhavethefollowingcodesfromthetables:TbHistoricoAnalogicousingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.IO;usingSystem.Com...
asked by 27.03.2017 / 19:04
1
answer

How to keep MVC application running in IIS Express (in Visual Studio) after stopping the debug?

I'm doing a project in ASP.Net MVC. On the company machine I run the project once (F5), stop the debug and continue accessing the application pages normally. On my personal machine if I stop the debug, the page says that it is not possible to...
asked by 06.03.2017 / 23:57
1
answer

Verify that the dynamic name file exists on disk

My program generates an XML file with the following name:    C: /FileFile/NOMETER_DOM_Data_NrFeaturesNoXML.xml At the moment, every time I generate a file and it has nrDeElementosNoXML other than nrDeElementosNoXML of the ex...
asked by 23.03.2017 / 12:37
1
answer

Manipulate page with WebBrowser

I'm having trouble sending values to a form via Web Browser . My goal is to make a post, that is, send the values to the inputs of the form and make the submit of it, after that open the page generated in my browser. Form...
asked by 23.01.2016 / 19:08
1
answer

EntityFramework ExecuteSqlCommand not accepting parameter

I'm running the ExecuteSqlCommand. With the correct mode, with parameter does not work: var SQL = "update POSTOFFICE set Status = 1 where name = '@url'"; dbMailEnable.Database.ExecuteSqlCommand(SQL, new SqlParameter("@url", EP.Cliente.Url...
asked by 25.02.2016 / 20:43