Questions tagged as 'c#'

1
answer

Visual Studio 2012 Missing references

I have a problem with references in my Visual Studio 2012 project. Does anyone have an idea how to solve this? I already downloaded some updates of the framework and tried to update some packages but still I have this error. The problem I think...
asked by 07.11.2016 / 20:35
1
answer

How to print in C # console a value extracted from sql server

I have this code, I just want to show a value that I get from a query to my DB in the console of C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading....
asked by 03.11.2016 / 17:27
1
answer

How can I change the icon of a Windows Form?

The window is open with 2 different buttons and shows different controls, depending on the button with which it was opened, but I do not know how to change the icon depending on the button with which it was instantiated. The Icon prope...
asked by 17.09.2016 / 18:38
2
answers

NullReferenceException when passing parameter value by method get from JavaScript function

I need to pass a value by method get . On the start page I have
asked by 14.09.2016 / 16:28
1
answer

I lost the Session variables in asp.net MVC

After having started the session, all the session variables are suddenly deleted. For example, I agree: [HttpPost] public ActionResult Login(MembersViewModels user) { if (ModelState.IsValid) { if (Isvalid(u...
asked by 11.09.2016 / 18:20
1
answer

File.Exists does not work as expected [closed]

I use the function File.Exists(path) and the path that happened to it, it does exist, but the result gives me false . Another thing is that when I run the File.Create(path) I get the exception saying that I do not have permissi...
asked by 31.10.2016 / 13:06
1
answer

How to get the value of a DataTable by applying LINQ

How to obtain the value of a field from a DataTable? I have managed to get the value of a field from a DataTable in the following way. var strSQL = "SELECT Id, Descripcion FROM Mensajes"; var dt = GetAll(strSQL); string result = dt.Rows[0][1]....
asked by 31.10.2016 / 02:37
2
answers

Convert from grid to array

I have a dataGridView1 with 3 columns name, amount and price I need to take them to the following format 000000010000001000Papas where:    (0000000100) (00001000) (Popes) The first is the price, the second the quantity and...
asked by 11.10.2016 / 06:39
1
answer

Visual Studio does not interpret a class that 'inherits' from Form as such

From what I understand, a form can only inherit from Form , it can not have multiple inheritances. That is, the following could not be done: public partial class frmCliente : Form, BaseMaestro<Cliente> However, if I do the foll...
asked by 15.10.2016 / 00:49
2
answers

How to use OfType

In a single Oftype you can do several searches like TextBox, ComboBox, etc. foreach (Control c in frm.Controls.OfType<TextBox>()) I want to achieve something like this foreach (Control c in frm.Controls.OfType<TextBox || TextBox...
asked by 16.10.2016 / 04:39