Questions tagged as 'c#'

1
answer

XmlDocument - list all elements?

I have a code XML similar to this: <document> <elemento> </elemento> </document> and the following C # code: ( x is an XmlDocument) for (int i = 0; i < x.ChildNodes.Count; i ++) { var el...
asked by 03.10.2017 / 23:42
1
answer

EF6 MVC5 C # - How to keep filters with page via QueryString

Good afternoon, I have several pages where the user can filter through 5 different fields and when the user clicks on the search button of the form, which is configured with the GET method, the search is passed in the URL as QueryString, a va...
asked by 08.11.2017 / 19:44
1
answer

Creating folders daily in C #

I have two separate programs from each other here, one of them creates folders named with the current date whenever I run it, so I made a schedule for it and daily it runs alone, and the other is to capture images from webCam, the of webCam is t...
asked by 08.11.2017 / 12:22
1
answer

Note1 and nota2 report errors and do not display storage in the array. Can anyone help? Thank you very much

namespace mediaDe5Alunos { class Program /*faça um programa para cálcular a média de duas notas de 5 alunos, mostrar a média da sala e de cada aluno e um relatório dos alunos*/ { static double calculo (double nota1, double not...
asked by 03.10.2017 / 18:33
1
answer

Check if there is a value in the enumeration by the attribute and return its value

Is it possible to produce simpler code for this function without changing enum ? /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] public enum Velocidade { //...
asked by 02.10.2017 / 20:44
1
answer

How to display domain validations and errors in a partial view modal bootstrap?

I'm using DDD and I have some validations in my domain that need to be done, however when I use ModelState.AddModelError and return my model and my PartialView, the form of my Partial does not remain in modal open. Instead, it displays an html p...
asked by 03.10.2017 / 07:50
2
answers

Consuming web service wsdl .net framework 2.0

When generating the request with all the correct parameters I have the return error 307 temporary redirect. Can you tell me what this error means?     
asked by 28.09.2017 / 16:08
1
answer

How to write data from an excel to an xml file

I would like to develop a program that has to read excel files and write to an xml file but I'm not sure how to write the data to the xml file. I'm reading the excel file like this: var fileName = @"C:\Users\HP8200\Desktop\test.xlsx"; var c...
asked by 27.09.2017 / 17:07
1
answer

Load two fields from a DataGrid using a txt file

How can I do this, see what I have so far: DataGrid, I need to load comboBox and valor unitário with values that I previously saved in a txt RecordProductsbutton,savename-priceprivatevoidbtnGravar_Click(objectsender,E...
asked by 27.10.2017 / 12:20
1
answer

How to format data extracted from datagridview to excel

private void button1_Click_1(object sender, EventArgs e) { Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel._Workbook workbook = app.Workboo...
asked by 26.10.2017 / 20:07