Questions tagged as 'c#'

2
answers

Separate entity from context

I'm working with Entity Framework 4.5.2, Visual Studio 2015 I have the following entity. public class Especificacion { public int EspecificacionId { get; set; } public string Nombre { get; set; } public virtual...
asked by 08.09.2018 / 17:40
1
answer

Because split of a string does not return the string? returns System.net

I have variables of session[] created in my application which I must occupy in the view to show that information that has stored in memory. The question is, how can I read that session [] 'in the view but only a part of the text they cont...
asked by 15.05.2018 / 22:11
2
answers

Validate Date of form dd / MM / yyyy hh: mm in c #?

I am trying to validate a date of the form dd / MM / yyyy hh: mm but in doing so with the code below, I would validate any correct date format. try { DateTime.Parse(Fecha); FechaError = 0;...
asked by 18.06.2017 / 18:42
2
answers

How to access and edit the properties of the controls contained in a UserControl? C #

I did a userControl that contains a Devexpress grid (DevExpress.XtraGrid.GridControl). What I want to do is access the properties of that grid in a Windows Form. Is there any way to do this? Greetings     
asked by 22.06.2017 / 14:38
1
answer

Improve a conditional if

I would like to improve this code, I am creating a game three in a row and this is an example to determine the winner in the first row. I would like to reduce it but it works the same. This is the code: if (((tablero[0] == tablero[3])&am...
asked by 06.08.2018 / 17:59
2
answers

Method that receives datetime nulleable, change format to MM / dd / yyyy

I have a question .. I have a method that receives several dates in datetime format (dd / mm / yyyy) Something like that public ActionResult Reports(DateTime? FechaInicio, DateTime? FechaFin, DateTime? IptSemana, DateTime? IptDia) At the...
asked by 10.08.2018 / 00:10
1
answer

How can I apply security to my Restful service in c # [closed]

I would like to know how I can apply security to my restful service that returns important customer data. I have no idea what to do and I am new to this.     
asked by 18.05.2018 / 22:30
2
answers

When creating my html element in an automated way with c # is it replaced and not added?

What I want to do is create several rows with their respective element within an accordion, then I leave the code that I put in my event clicserver public string RowsAdd = ""; RowsAdd += "<section class='col-lg-12 text-ce...
asked by 29.06.2018 / 19:06
1
answer

Print without preview in C #, ReportViewer

I explain what I need. I have this view created in c #, for a desktop application. And as you will see, I have another 3 more, which I will load in a reportViewer . Then the process to print is as follows: Then -...
asked by 30.06.2018 / 17:19
1
answer

Extract the value of an Item from a DropDownList that is filled with a sql server C # query and aspx

I have a DropDownList called Sale that I fill in as follows: DataRow fila = dtr.Rows[0]; OdbcCommand cmd = new OdbcCommand("SELECT A.CardCode, A.CardName, B.SlpName FROM OCRD A INNER JOIN OSLP B ON A.SlpCode = B.SlpCode WHERE B.SlpCode ='"...
asked by 29.06.2018 / 19:28