Questions tagged as 'c#'

1
answer

Order of the Fields in XML WCF

I rengo a case with a WCF that does not allow me to receive the data correctly when consuming it from an external tool, example (SOAP UI), I have the following DataContract : [DataContract] public class Ticket { [DataMember] publ...
asked by 30.08.2016 / 17:45
1
answer

Obtain various properties of the object

Hi, I would like to know what solutions there are to reduce an object. I have a model which is used as a return in the controller but I'm only interested in certain properties of that model. The main idea I came up with was to create an anonymou...
asked by 12.07.2016 / 10:02
1
answer

How to validate decimals asp c #

I would like to know how to validate a decimal value in TextBox , what happens is that when I write a decimal example 12..00 or 12...55 my system goes down, I want to validate only the point and a single point in ASP C #. &...
asked by 25.03.2017 / 19:20
1
answer

Test if a list is unique in C #

I have a list List<byte> unaLista = new List<byte> { 1,4,3,6,1 }; How can I test whether this unqiue or not?     
asked by 01.12.2015 / 18:05
2
answers

Is it possible to save what is drawn in the "Panel" control using the Paint event?

Next I use the following code to save and draw. But when saving does not save what is drawn. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System....
asked by 27.01.2016 / 20:21
2
answers

Empty rows with OpenXml Excel

I'm going through an excel with the library DocumentFormat.OpenXml , and when I get the rows, I get rows in which the cells are empty; that is, I have an excel where you only have information in the first 10 rows, but you are extracting in...
asked by 05.02.2016 / 20:28
2
answers

Transaction Management in the Entity Framework

I'm working with Entity Framework 6 approach code-first, is it necessary to use transaction when registering header and detail, when using EF6? public void InsertOrUpdate(Compra entity) { using (var context = new PosContext())...
asked by 24.08.2016 / 01:21
1
answer

How to traverse array values after inserting a value in a busy place

In a console application, where I have a string type arrangement, one of the operations allows inserting values in places that are occupied, for example: I have an array in the following way: {cero, uno, 0, 0 ,0} . The zeros are null va...
asked by 22.02.2016 / 21:13
1
answer

Mapping in model two fields first key

I have a table whose structure is composed of two PK, I want to include it in my model to insert records to it, but I have problems doing this my question is how do I declare in my model that I have those two fields as pk, I tried that way...
asked by 05.12.2018 / 17:46
1
answer

Convert string to System.IO.Ports.Parity C #

I have a constructor to connect to the serial port of the type: PortConx = new SerialPort(puerto); And I define its parameters in the following way through a textbox: PortConx.Parity = Parity.Even; PortConx.StopBi...
asked by 30.12.2016 / 03:38