Questions tagged as 'c#'

1
answer

Linq C # Outer Join Show the values that are not in the fields to compare

I have the following doubt, I hope you can help me. I have two tables, one of subjects and another that assigns the subjects to the students through their id. "Not all subjects have students assigned." They ask me to show with linq those subject...
asked by 17.02.2018 / 22:22
4
answers

MVC View Conditions

I need my program to do the following flow control, but the else does not detect it, it's as if it was not written. Code: <table class="table"> <thead> <tr> <th&...
asked by 24.01.2018 / 12:10
2
answers

Use polymorphism in objects of classes that implement the same interface?

Is it possible? Or they must necessarily inherit from the same parent class ... public interface interfaz { } public class a : interfaz { } public class b : interfaz { } public class prueba { public void X() { a objetoA =...
asked by 08.02.2018 / 19:12
2
answers

Pass htmlAttributes to EditorFor template

Good morning! I am working on templates for EditorFor for the different types of data, specifically int and double in order to generate them in text type, with a oninput that validates me not to enter incorrect informat...
asked by 27.04.2018 / 14:12
2
answers

analyze xml with linq

I need to please, see if someone can light me up a bit, since I have an xml with information about alerts of a medication that is obtained from a REST service published on a server. the answer comes in xml format, and I'm trying to read it with...
asked by 05.09.2017 / 16:32
1
answer

I want my database to delete data after 30 days of being saved SQL - RAZOR

(Use RAZOR) What I need is for my database to delete ROWS created 30 days ago, the creation date I am saving in a Datetime type field. So far I can only subtract and obtain the day address, for example: var Fecha = solicitud.fechainicio - Date...
asked by 02.10.2017 / 15:10
1
answer

Use SCOPE_IDENTITY to fetch the ID of an insert

I have a user table where when adding a user I can assign several hotels, which is another insert to a table from many to many. Researching a bit I can use the scope_identity() to be able to do this since it brings me the last reco...
asked by 24.07.2017 / 23:06
1
answer

the operator '==' can not be applied to operands of type int

I have this error message when I call or create a enum , this is the enumerator public enum mexTipAutent :int { mvxBD = 2, mvxWA = 4, mvxAPP = 8, } and this is the call where the error marks me if (pnTipAutent == clsBaseDatos.mex...
asked by 15.07.2017 / 20:35
2
answers

Doubt about exception c #

Because when I have the three errors, only the first one, the day one, and the month and year one, do not shoot? if (di > 0 && di <= 31) { dia = di; } else { throw new Exception("\n"+ "El día no puede ser menor que 1 ni m...
asked by 24.07.2017 / 20:28
2
answers

SQL syntax error in MySql [duplicated]

This is the error that presents me when I want to save my data now, sorry that I did not raise it.     
asked by 17.08.2017 / 18:05