Archives

Archives / 2008 / July
  • Official Note: Version 1.0 RTM of the SQL Server 2005 Driver for PHP is live!

    It's official. You can now download version 1.0 RTM of the SQL Server 2005 Driver for PHP from the MSDN download site

    The SQL Server 2005 Driver for PHP download is available to all SQL Server users at no additional charge.

    The SQL Server 2005 Driver for PHP is a PHP 5 extension that allows for the reading and writing of SQL Server data from within PHP scripts. The extension provides a procedural interface for accessing data in all editions of SQL Server 2005.

    Enjoy!

    Read more...

  • Noticia Oficial: La Versión 1.0 RTM Del Driver de SQL Server 2005 Para PHP Ha Sido Liberada

    La versión 1.0 del Driver de SQL Server 2005 para PHP está disponible en el sitio de descargas de MSDN.

    Ahora si, no hay excusas. Esta, es una extensión de PHP 5 que permite la lectura y escritura de datos almacenados en SQL Server 2005 desde scripts de PHP. La extensión provee de una interface procedural para el acceso a datos de cualquier edición de SQL Server 2005.

    Saludos.

    Read more...

  • Having RadioButtons on a Repeater or DataList

    Repeaters are very powerful controls that allows us to present formated information from a datasource.

    Recently I needed to include some RadioButtons inside a Repeater so I could select one of the items from the repeater, but to my surprise, and old bug resurfaced. Reference to the bug can be found here but I will include some information regarding it:

    SYMPTOMS

    When you add a ASP.NET RadioButton control to the ItemTemplate of a data-bound Repeater server control, the RadioButton control that you created is not mutually exclusive when you run the ASP.NET page. This problem occurs even if the GroupName attribute is set for the RadioButton controls.

    CAUSE

    This problem occurs because the Repeater server control implements the INamingContainer interface, which requires that all controls that are nested within it must have a unique name when rendered in Hypertext Markup Language (HTML). Therefore, the HTML name attribute of any rendered child server control is unique.

    STATUS

    Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

    Well, the products in cuestion are:

    • Microsoft ASP.NET 1.0
    • Microsoft ASP.NET 1.1

    But guess what, it happens also in ASP.NET 2.0/3.0/3.5, so someone forgot to fix this thing.

    Anyway, I found this very helpful article from Erick Smith at CodeGuru.com that helps overcome this problem. The solution is a JavaScript function that will be attached to every RadioButton as it is being bounded in the Repeater. The function is:

    function SetUniqueRadioButton(nameregex, current)
    {
          re =
    new RegExp(nameregex);
         
    for(i = 0; i < document.forms[0].elements.length; i++)
          
    {
                elm = document.forms[0].elements[i]
                
    if (elm.type == 'radio')
                {
                     
    if (re.test(elm.name))
                      {
                              elm.checked =
    false;
                      }
                 }
          }
          current.checked =
    true;
    }

    That you must add to your page on the HEAD section. Then link the function to the RadioButtons in the OnItemDataBound event for the Repeater. NOTE that you must know the Repeater name and the GroupName for the RadioButtons. For this example, the name of the Repeater is "Repeater1" and the name of the RadioButtons GroupName property is "RadioGroup".

    And that's it. You will end up with a bunch of RadioButtons all with the same GroupName and working as expected.

    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
         
    if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return;
         
    RadioButton rb = (RadioButton) e.Item.FindControl("RadioButton");
          string script = "SetUniqueRadioButton('Repeater1.*RadioGroup',this)";
          rb.Attributes.Add(
    "onclick", script);
    }

    But you know what, this can also be applied for DataList controls. In the source code that I've included I have a page with a Repeater and a DataList so you can see that it's exactly the same form of solution.

    Hope you like it. Enjoy!

     

    Read more...

  • Ensure Proper Closure & Disposal Of A DataReader

    Most of the time, we create programs that use DataReaders (weather they are on ASP.NET or Winforms). They're fast, easy to use but sometimes, they fill out our connections pool and withour proper care, they can cause problems to our users.

    There are some blog posts around this issue and many questions in the forums, so I'll try to make it as simple as possible so you'll find it attractive to use, because in the end, there is no magic here, just a nice tip.

    The solution: Use the DataReader within the scope of a using clause. How? Take a look at this sample:

    Regular Programming
    In general, programmers tend to use DataReaders like this:

    SqlConnection connection = new SqlConnection("connection string");
    SqlCommand cmd = new SqlCommand("SELECT * FROM SomeTable", connection);
    SqlDataReader reader = cmd.ExecuteReader();
    if (reader != null)
    {
          while (reader.Read())
          {
                 
    //do something
          
    }
    }
    reader.Close();
    reader.Dispose();

    While this would work and do excatly what you need it to do, it does not ensure that the reader will be actualy closed and disposed. Why? it's by design. DataReaders will be kept open until they got all the data from the source and even then, they depend on the command object that should be opened with the CommandBehavior.CloseConnection parameter.

    So, anyway. Here is my proposed solution to overcome this problems.

    using (SqlDataReader reader = cmd.ExecuteReader())
    {
           if (reader != null)
           {
                  while (reader.Read())
                  {
                            //do something
                  }
                  reader.Close();
                  reader.Dispose();
           }
    }

    Why this works better? Because the DataReader lives only within the scope of the using clause. Once the flow leaves the using clause the datareader is forced to deallocate from memory thus closing/disposing it properly.

    Hope this will help you get the most of DataReaders because, yes, they are the FASTEST way to get data from any datasource.

    Enjoy!!

     

    Read more...

  • Ya Disponible: Preview 1 de ASP.NET AJAX 4.0

    Ya es oficial!!

    El Primer Preview de ASP.NET Ajax 4.0 acaba de salir a la luz. Pueden ver el Roadmap para mas información sobre el contenido de este preview y si pueden, por favor envíen un poco de feedback.

    Este preview contiene (entre otros) las siguientes implementaciones:

    • Client-side template rendering
    • Declarative instantiation of behaviors and controls
    • DataView control
    • Markup extensions
    • Bindings

    La página de descarga de CodePlex está aquí.

    Saludos!!

    Read more...

  • Now Available at CodePlex: ASP.NET AJAX 4.0 Preview 1

    Well, it's official. The first preview for the new Ajax features in ASP.NET just went live. Check out the Roadmap for information about what it covers and if you can, provide some feedback.

    This preview contains preview implementations for the following features:

    • Client-side template rendering
    • Declarative instantiation of behaviors and controls
    • DataView control
    • Markup extensions
    • Bindings

    You can find the download page at CodePlex here.

    Enjoy!!

     

    Read more...

  • Now Available: SubSonic 2.1 is Finally Here :)

    Hi all.

    I'm a bit late but it's never late for good news. It's here, now SubSonic 2.1 has finally arrived.

    Description

    • SqlQuery, our next-generation querying engine
    • SubStage, a visual configuration management and code generation tool
    • Programmatic migrations between database versions
    • Greatly improved documentation across the entire code base
    • Improvements in performance and stability
    • ...and a massive collection of bug fixes and assorted goodies

    You can get it from the codeplex website here.

    Enjoy!

    Read more...

  • SubSonic 2.1 Liberado

    Hola a todos.

    Un poco tarde lo se, pero nunca es tarde para las buenas noticias. Ya ha sido liberada la versión 2.1 de SubSonic.

    Descripción

    • SqlQuery, el motor de consultas de siguiente generación
    • SubStage, una herramienta visual de generación de código y administración de configuración
    • Migraciones programadas entre diferentes versiones de bases de datos
    • Documentación mejorada
    • Mejoras en rendimiento y estabilidad
    • ... y una masiva colección de arreglos a problemas y diferentes cositas para ayudarnos

    Pueden descargarlo del sitio de codeplex aquí.

    Saludos.

    Read more...

  • ASP.NET MVC Preview 4 - Muy Cerca De Ser Liberado

    Hola a todos.

    El lunes 14 de julio, Scott Guthrie anunció en su blog la inminente llegada del ASP.NET MVC Preview 4 (posiblemente a finales de esta semana).

    Dentro de las innovaciones que traerá el P4 encontraremos:

    • Mejoras en los Filter Interceptors
    • Filtros de Cache
    • Filtros de manejo de errores
    • Filtros de autorización
    • Nuevas clases para manejo de cuentas y autenticación
    • Clase Controller con mejoras en la colección TempData
    • Extenso manejo de AJAX

    Esperemos que pronto podamos descargar este nuevo preview y ojalá que se interesen en esta nueva tecnología.

    Saludos.

    Read more...

  • Understanding INNER JOINS in detail

    Hi all.

    I just got a link to this nice article about inner joins on SQLServerCentral.com by Susantha Bathige.

    The objective of this article is dig into detail of how INNER join produce the result set. The INNER join is the common join type used by many cases. Even though it uses very often I have seen most of them are not certain how it produces the result set when change the joining condition.

    To get acces to SQLServerCentral you need to register, but it only takes 20 seconds and you'll get access to really cool stuff.

    Hope you like it just as much as I did.

     

    Read more...

  • Próxima Reunión de la Comunidad de Desarrolladores .NET de Cobán

    Prepárate para mejorar tus habilidades de programador. Después de esta atender a esta reunión de la Comunidad de Desarrolladores .NET de Cobán nunca volverás a programar igual. Hablaremos de de lo que es Refactoring y cómo nos ayuda a ser más productivos; además tomaremos como caso de estudio el producto de software Resharper de la empresa JetBrains. Presentadores:
    • José Rolando Guay Paz
    • Carlos Enrique Portillo Moeschler
    • Erick Leonel Calel Coy
    Lugar:
    Biblioteca del Colegio Particular Mixto Verapaz
    Fecha:
    Julio 26 de 2008
    Hora:
    5:00pm
    5:00 p.m.
    Registro y Bienvenida
    5:15 p.m.
    Inicio del evento con información general sobre actividades e información de la comunidad
    5:30 p.m.
    Charla sobre aspectos Refactoring e Introducción a ReSharper
    Presentador: José Rolando Guay Paz
    6:00 p.m.Otros aspectos de ReSharper  Presentadors:   Carlos Enrique Portillo Moeschler y Erick Leonel Calel Coy
    6:30 p.m.
    Rifas
    6:45 p.m.
    Refrigerio y Despedida
       
     

    Read more...

  • Free for Developers: IdeaBlade DevForce Express

    Hi all.

    I want to share this information about a product called DevForce from the company IdeaBlade.

    DevForce is an extensible .NET application server and development framework. Simplifies data access, improves user-interface design, and enables rich on-demand applications to operate over the internet. In addition, DevForce provides a complete migration path to, and support for, next-generation Microsoft technologies such as LINQ, WPF, and Silverlight. Check the different versions here.

    The good news is that it's Express Edition is freely available to all developers and you can download it here. All you have to do is register and off you go.

    Hope this helps you be more efficient at work (or just for fun :) ).

    See ya...

    Read more...