La boludez que siempre me olvido:

DataTable.Columnd.Add:

this._testDataTable.Columns.Add(“Minimo”, System.Type.GetType(“System.Int32″));

this._testDataTable.Columns.Add(“Maximo”, System.Type.GetType(“System.Int32″));

DataTable.Rows.Add:

this._informeMesaControl.Rows.Add(new Object[] { 1, 200,  });

Trailer Dragon Ball Z :D

18 Noviembre 2008

Via Fabio las peores peleas del cine, ninguna mejor que estas 2:

PDFSharp

29 Octubre 2008

//Create a document

PdfDocument pdf = new PdfDocument();

//Create a Page

PdfPage page = new PdfPage();

page.Size = PageSize.A4;

pdf.AddPage(page);

// Create a font

XGraphics gfx = XGraphics.FromPdfPage(pdf.Pages[0], XGraphicsPdfPageOptions.Append);

XFont font = new XFont(“Times New Roman”, 12, XFontStyle.Regular);

XTextFormatter tf = new XTextFormatter(gfx);

//Write header

x = 20;

y = 2;

tf.DrawString(“Name”, font, XBrushes.Black,new XRect(x, y, 40, 20),   XStringFormat.TopLeft);

x = x + 42;

tf.DrawString(“Surname”, font, XBrushes.Black, new XRect(x, y, 270, 20), XStringFormat.TopLeft);

x = x + 272;

//Write Data

y = 105;

foreach (DataRow row in data.Rows)

{

x = 20;

tf.DrawString(row["Name"].ToString(), font, XBrushes.Black, new XRect(x, y, 40, 20), XStringFormat.TopLeft);

x = x + 42;

tf.DrawString(row["Surname"].ToString(), font, XBrushes.Black, new XRect(x, y, 270, 20), XStringFormat.TopLeft);

x = x + 272;

recordCount = recordCount + 1;

y = y + 20;

}

//Save the document.

pdf.Save(toFilename);

//Send document to client.

Response.Clear();

Response.ContentType = “application/pdf”;

Response.AddHeader(“Content-Disposition”, “attachment; filename=” +   toFilename.Substring(toFilename.LastIndexOf(@”\”) + 1));

Response.WriteFile(toFilename);

}

RAISERROR en UDF —> NOT!

18 Septiembre 2008

Recien descubro que en SQL Server 2000 no se puede usar RAISERROR dentro de una UDF. Asi que no queda más que convertir la función en un SP o retornar NULL o algo parecido. Osea… una cagada.

Este error me aparecio ayer cuando intentaba debugear una aplicación web en Visual Studio 2003:

“Unable to start debugging on the Web server”

Lo primero obviamente es chequear que el web.config este bien configurado, osea que aparezca esta linea :

<compilation defaultLanguage=”vb” debug=”true” />

Tras  cambiar el web.config me aparecion un nuevo error:

“Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in the Internet zone.”

Tras googlear encontre esta solución:

1. En Internet Explorer ir a Opciones de Internet

2. Ir al tab de Seguridad.
3. Elegir el icono de Internet y apretar Custom Level
4. En la seccion de “User Authentication” seleccionar:
    Select “Automatic logon with current username and password”.
Con esto la solucion se ejecuto sin errores. Hay otras soluciones MSDN , WebLatam a este problema pero para este caso no me sirvieron.