Questions tagged as 'c#'

1
answer

Property of a class that belongs to another context in the Entity Framework

I have a class called Locker that has the following property: public virtual ICollection<LockerReserve> Reserves { get; set; } The problem is that LockerReserve belongs to a context other than Locker. An exception is thrown whenever I...
asked by 30.11.2015 / 13:29
1
answer

How to insert values into a relational table when inserting a row and get this ID?

I am building a program to insert excel file data into a database. My database has this structure: Tables (and fields): Schedule ( PK ), StartTime, EndTime, DayWeek, RoomId ( FK ), ClassId < FK ), TeacherId ( FK )) Rooms (RoomId ( PK...
asked by 29.03.2015 / 04:20
2
answers

KeyDown Event + Enter. Clear keyboard buffer

I created an example WinForm C # .net sample containing textbox1 , textbox2 and button1 to simulate the following situation: When you start the application, the textbox1 gets the focus and when we press Enter , its...
asked by 30.04.2015 / 14:13
1
answer

Display a button based on the action of another

I'm a beginner in ASP.NET MVC I have a project. And within a given view I have two buttons. However, one of them can only appear if the other is executed. 1 > Save (save car) 2 > Associate a dealership (it can only be activated wh...
asked by 17.10.2015 / 22:38
1
answer

OR join using Linq

I have the following tables: Tabela1 Tabela2 Tabela3 Tabela4 +----+-----------+ +----+-----------+------+------+ +----+-----------+------+------+ +----+-...
asked by 14.10.2015 / 13:47
1
answer

How to convert a Bytes Array to a Direct Image in the ListView?

Populate the DataSource of the ListView with a collection. The collection contains a field with ArrayBytes . I need to convert to the image to appear in the control. But does the conversion have to be straightforward? <ItemTemplat...
asked by 12.10.2015 / 21:20
1
answer

How to kill a specific user process on Windows Server?

I have a C # application that ultimately needs to kill a user process that ran, but as I am on a Terminal Server (Windows Server) and there are multiple logged in users, when I put the command to kill the process Process[] processo = Process.G...
asked by 11.08.2015 / 18:59
2
answers

Pass variable to another form, dynamically generated C #

I have a relative question of passing the value from one button to another form. I have the following code private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { string cod_evento = dataGr...
asked by 08.12.2015 / 12:27
1
answer

Text overwriting the header

I have tagged the C# tag since almost all the examples found on the internet are in this language and "translate" to vb.net is very simple. My report based on iTextSharp is dynamic. It has a header with the base informatio...
asked by 13.07.2015 / 21:29
1
answer

Show more than one column value from dropdown C #

How could I show more than the value of a column in a dropdown? I tried the following method: private void BindDropDownList() { DataTable dt = new DataTable(); string localidade = string.Empty; string distrito =...
asked by 12.07.2015 / 00:38