Joruus Joruus

View SqlParameterWith0NoOK.cs
1 2 3 4 5
string sql = "INSERT INTO Incidencias (Estado) VALUES (@Estado)";
 
SqlParameter paramEstado = new SqlParameter("Estado", 0);
 
SqlHelper.ExecuteScalar(CommandType.Text, sql, paramEstado);
View SqlParameterWith0OK.cs
1 2 3 4 5
string sql = "INSERT INTO Incidencias (Estado) VALUES (@Estado)";
 
SqlParameter paramEstado = new SqlParameter("Estado", Convert.ToInt32(0));
 
SqlHelper.ExecuteScalar(CommandType.Text, sql, paramEstado);
View datetimeDosDigitosAño.cs
1 2 3 4 5 6 7 8
DateTime dt;
string datetime = "120101";
 
DateTime.TryParseExact(datetime,
"yyMMdd",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out dt);
View UtilidadesDateTime.cs
1 2 3 4 5 6 7 8 9
public static class UtilidadesDateTime
{
public static CultureInfo Cultura { get; private set; }
static UtilidadesDateTime()
{
Cultura = new CultureInfo(CultureInfo.CurrentCulture.LCID);
Cultura.Calendar.TwoDigitYearMax = 2099;
}
Something went wrong with that request. Please try again.