Questions tagged as 'c#'

3
answers

Multiple models in an ASP NET MVC view [duplicated]

Hello friends I'm still stuck with this, someone can help me out ... This is my error: These are my models and my htmlCs //kyo es el nombre de mi vista, este es el controller //GET: Home/kyo [Authorize]...
asked by 14.09.2017 / 20:02
2
answers

Take a file path from an array of C # files

I have an array of files, and I have to get the string from one's route. I can not find any method that does it. The code what it does is go through two directories of files, and then look for the first file of the source directory in the destin...
asked by 02.10.2017 / 12:25
2
answers

How to truncate a double variable to 4 decimals in c #? [closed]

How to make a double variable show me only 4 digits after the decimal? that is not round.     
asked by 14.09.2017 / 05:42
1
answer

How to display the ports of my pc in a combobox c # windows form?

The truth is that I do not know how to start. when we right click and go to Device Manager shows us in the ports a list of connected devices, now I want to know how I can bring that same list to my combobox, work in windowsForm c #:     
asked by 16.10.2017 / 22:18
3
answers

Why does ExecuteNonQuery () give me the following error?

Good will put my code here and have if someone can tell me what error I have here because I can not see it public List<EntidadProducto> listarProductosCD(SqlConnection conexion, int ID, String nombre, decimal precio) { List&l...
asked by 23.10.2017 / 00:32
1
answer

Change value to App.config file

I am trying to change the value of the App.config file and it does not save anything to me, I do not get any errors when saving, and when it rerun the program continues with the same value. var configFile = ConfigurationManager.OpenExeConfigur...
asked by 27.10.2017 / 10:57
2
answers

Get properties of an ASP.NET file Razor C #

Hello, I'm doing a module in ASP.NET with Razor and C # where I upload a file of any type to a database , along with other data. I need to get the properties of the file on the server side ("with C # "), in order to be able to append thes...
asked by 27.10.2017 / 19:16
1
answer

Is it possible to construct an object of a class or declare a variable directly in the return of a method?

Suppose I have this method ... private BigInteger Numero(string cadena) { if (CadenaConValor(cadena) != 0 && CadenaOk(cadena)) { BigInteger n; return n...
asked by 22.09.2017 / 17:51
1
answer

Error: "The conversion of the nvarchar value '92012156148' overflowed an int column"

What I am trying to do is to capture in a textbox the identification number of a person, save the value in a variable, look for it in the database and show the name in label. This is the code: SqlConnection conexion = new SqlConnection("ser...
asked by 24.07.2017 / 05:14
1
answer

Mark all the checkboxes of the child nodes of a node in a TreeView

In a form I have a treeview (tvArbol). The same, complete it with all the directories and files of Windows. To do this, every time I expand a node, I obtain and complete the treeview with the nodes "children" of the expanded node. All nodes h...
asked by 03.07.2017 / 21:14